~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to release/scripts/op/io_scene_x3d/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Kevin Roy
  • Date: 2011-02-08 22:20:54 UTC
  • mfrom: (1.4.2 upstream)
  • mto: (14.2.6 sid) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: james.westby@ubuntu.com-20110208222054-kk0gwa4bu8h5lyq4
Tags: upstream-2.56.1-beta-svn34076
ImportĀ upstreamĀ versionĀ 2.56.1-beta-svn34076

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ##### BEGIN GPL LICENSE BLOCK #####
 
2
#
 
3
#  This program is free software; you can redistribute it and/or
 
4
#  modify it under the terms of the GNU General Public License
 
5
#  as published by the Free Software Foundation; either version 2
 
6
#  of the License, or (at your option) any later version.
 
7
#
 
8
#  This program is distributed in the hope that it will be useful,
 
9
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
#  GNU General Public License for more details.
 
12
#
 
13
#  You should have received a copy of the GNU General Public License
 
14
#  along with this program; if not, write to the Free Software Foundation,
 
15
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
16
#
 
17
# ##### END GPL LICENSE BLOCK #####
 
18
 
 
19
# <pep8 compliant>
 
20
 
 
21
# To support reload properly, try to access a package var, if it's there, reload everything
 
22
if "bpy" in locals():
 
23
    import imp
 
24
    if "export_x3d" in locals():
 
25
        imp.reload(export_x3d)
 
26
 
 
27
 
 
28
import bpy
 
29
from bpy.props import *
 
30
from io_utils import ExportHelper
 
31
 
 
32
 
 
33
class ExportX3D(bpy.types.Operator, ExportHelper):
 
34
    '''Export selection to Extensible 3D file (.x3d)'''
 
35
    bl_idname = "export_scene.x3d"
 
36
    bl_label = 'Export X3D'
 
37
 
 
38
    filename_ext = ".x3d"
 
39
    filter_glob = StringProperty(default="*.x3d", options={'HIDDEN'})
 
40
 
 
41
    use_apply_modifiers = BoolProperty(name="Apply Modifiers", description="Use transformed mesh data from each object", default=True)
 
42
    use_triangulate = BoolProperty(name="Triangulate", description="Triangulate quads.", default=False)
 
43
    use_compress = BoolProperty(name="Compress", description="GZip the resulting file, requires a full python install", default=False)
 
44
 
 
45
    def execute(self, context):
 
46
        from . import export_x3d
 
47
        return export_x3d.save(self, context, **self.as_keywords(ignore=("check_existing", "filter_glob")))
 
48
 
 
49
 
 
50
def menu_func(self, context):
 
51
    self.layout.operator(ExportX3D.bl_idname, text="X3D Extensible 3D (.x3d)")
 
52
 
 
53
 
 
54
def register():
 
55
    bpy.types.INFO_MT_file_export.append(menu_func)
 
56
 
 
57
 
 
58
def unregister():
 
59
    bpy.types.INFO_MT_file_export.remove(menu_func)
 
60
 
 
61
# NOTES
 
62
# - blender version is hardcoded
 
63
 
 
64
if __name__ == "__main__":
 
65
    register()