goat3d
view exporters/blendgoat/src/__init__.py @ 38:60f2037680ee
split the exporter into two files to make it more readable (and maybe make an importer too at some point?)
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 07 Oct 2013 20:02:57 +0300 |
parents | |
children | 0e48907847ad |
line source
1 bl_info = {
2 "name": "Goat3D scene",
3 "author": "John Tsiombikas",
4 "version": (0, 1),
5 "location": "File > Import-Export",
6 "description": "Mutant Stargoat, Goat3D scene file format: http://code.google.com/p/goat3d/",
7 "category": "Import-Export"
8 }
10 if "bpy" in locals():
11 import imp
12 if "export_goat" in locals():
13 imp.reload(export_goat)
15 import bpy
16 from bpy_extras.io_utils import ExportHelper
18 class ExportGoat3D(bpy.types.Operator, ExportHelper):
19 bl_idname = "export_scene.goat3d"
20 bl_label = "Export Goat3D Scene"
21 bl_options = {'PRESET'}
22 filename_ext = ".goatsce"
23 filter_glob = bpy.props.StringProperty(default="*.goatsce", options={'HIDDEN'})
25 def execute(self, ctx):
26 from . import export_goat
27 if not export_goat.export(self, ctx, self.filepath):
28 return {'CANCELLED'}
29 return {'FINISHED'}
31 def menu_func(self, ctx):
32 self.layout.operator_context = 'INVOKE_DEFAULT'
33 self.layout.operator(ExportGoat3D.bl_idname, text="Goat3D scene export (.goatsce)")
35 def register():
36 bpy.utils.register_module(__name__)
37 bpy.types.INFO_MT_file_export.append(menu_func)
39 def unregister():
40 bpy.utils.unregister_module(__name__)
41 bpy.types.INFO_MT_file_export.remove(menu_func)
43 if __name__ == "__main__":
44 register()