~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to release/scripts/colladaImport14.py

  • Committer: Bazaar Package Importer
  • Author(s): Lukas Fittl
  • Date: 2006-09-20 01:57:27 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060920015727-gmoqlxwstx9wwqs3
Tags: 2.42a-1ubuntu1
* Merge from Debian unstable (Closes: Malone #55903). Remaining changes:
  - debian/genpot: Add python scripts from Lee June <blender@eyou.com> to
    generate a reasonable PO template from the sources. Since gettext is used
    in a highly nonstandard way, xgettext does not work for this job.
  - debian/rules: Call the scripts, generate po/blender.pot, and clean it up
    in the clean target.
  - Add a proper header to the generated PO template.
* debian/control: Build depend on libavformat-dev >= 3:0.cvs20060823-3.1,
  otherwise this package will FTBFS

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!BPY
 
2
 
 
3
"""
 
4
Name: 'COLLADA 1.4(.dae) ...'
 
5
Blender: 241
 
6
Group: 'Import'
 
7
Tooltip: 'Import scene from COLLADA 1.4 format (.dae)'
 
8
"""
 
9
 
 
10
__author__ = "Illusoft - Pieter Visser"
 
11
__url__ = ("Project homepage, http://colladablender.illusoft.com")
 
12
__version__ = "0.2.65"
 
13
__email__ = "colladablender@illusoft.com"
 
14
__bpydoc__ = """\
 
15
 
 
16
Description: Imports a COLLADA 1.4 file into a Blender scene.
 
17
 
 
18
Usage: Run the script from the menu or inside Blender. 
 
19
"""
 
20
 
 
21
# --------------------------------------------------------------------------
 
22
# Illusoft Collada 1.4 plugin for Blender version 0.2.65
 
23
# --------------------------------------------------------------------------
 
24
# ***** BEGIN GPL LICENSE BLOCK *****
 
25
#
 
26
# Copyright (C) 2006: Illusoft - colladablender@illusoft.com
 
27
#
 
28
# This program is free software; you can redistribute it and/or modify
 
29
# it under the terms of the GNU General Public License as published by
 
30
# the Free Software Foundation; either version 2 of the License,
 
31
# or (at your option) any later version.
 
32
#
 
33
# This program is distributed in the hope that it will be useful,
 
34
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
35
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
36
# GNU General Public License for more details.
 
37
#
 
38
# You should have received a copy of the GNU General Public License
 
39
# along with this program; if not, write to the Free Software Foundation,
 
40
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
41
#
 
42
# ***** END GPL LICENCE BLOCK *****
 
43
# --------------------------------------------------------------------------
 
44
 
 
45
import sys
 
46
import Blender
 
47
 
 
48
error = False
 
49
 
 
50
######################## SET PATH TO FOLDER consisting 'colladaImEx' here (if necessary)
 
51
        
 
52
# Example:
 
53
   
 
54
# scriptsDir = "C:/Temp/"
 
55
   
 
56
scriptsDir = ""
 
57
        
 
58
#############################################################################
 
59
 
 
60
try:
 
61
        import colladaImEx.cstartup
 
62
        if Blender.Get('scriptsdir') is None:
 
63
                if scriptsDir == '' or scriptsDir is None:
 
64
                        Blender.Draw.PupMenu("Cannot find folder %t | Please set path in file 'colladaImport14.py'")
 
65
                        error = True
 
66
                else:
 
67
                        loc = scriptsDir
 
68
        else:
 
69
                loc = ""
 
70
except ImportError:
 
71
        # Check if full version of python is installed:
 
72
        try:
 
73
                import os
 
74
                pythonFull = True
 
75
        except ImportError:
 
76
                pythonFull = False
 
77
        
 
78
        if not pythonFull:
 
79
                from sys import version_info
 
80
                version = '%s.%s' % version_info[0:2]
 
81
                print """
 
82
This script requires the xml module that is part of a
 
83
default standalone Python install.
 
84
 
 
85
To run the collada importer and exporter you need to have
 
86
Python version %s installed in your system. It can be downloaded from:
 
87
 
 
88
http://www.python.org
 
89
 
 
90
Notes:
 
91
- The minor (third) version number doesn't matter, you can have either
 
92
Python %s.1 or %s.2 or higher.
 
93
- If you do have Python %s installed and still can't run the scripts, then
 
94
make sure Blender's Python interpreter is finding the standalone modules
 
95
(run 'System Information' from Blender's Help -> System menu).
 
96
""" % (version, version, version, version)
 
97
                Blender.Draw.PupMenu("Please install full version of python %t | Check the console for more info")
 
98
                error = True
 
99
        else:   
 
100
                if scriptsDir == "":
 
101
                        Blender.Draw.PupMenu("Cannot find folder %t | Please set path in file 'colladaImport14.py'")
 
102
                        error = True
 
103
                else:
 
104
                        if scriptsDir not in sys.path:
 
105
                                sys.path.append(scriptsDir)
 
106
                        try:
 
107
                                import colladaImEx.cstartup
 
108
                                loc = scriptsDir
 
109
                        except:
 
110
                                Blender.Draw.PupMenu("Cannot find colladaImEx files %t | Please make sure the path is correct in file 'colladaImport14.py'")
 
111
                                error = True
 
112
except StandardError:
 
113
        error = True
 
114
                                
 
115
if not error:
 
116
        try:
 
117
                reload(colladaImEx.cstartup)
 
118
                colladaImEx.cstartup.Main(True, loc)
 
119
        except StandardError:
 
120
                pass