goat3d

annotate 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
rev   line source
nuclear@38 1 bl_info = {
nuclear@38 2 "name": "Goat3D scene",
nuclear@38 3 "author": "John Tsiombikas",
nuclear@38 4 "version": (0, 1),
nuclear@38 5 "location": "File > Import-Export",
nuclear@38 6 "description": "Mutant Stargoat, Goat3D scene file format: http://code.google.com/p/goat3d/",
nuclear@38 7 "category": "Import-Export"
nuclear@38 8 }
nuclear@38 9
nuclear@38 10 if "bpy" in locals():
nuclear@38 11 import imp
nuclear@38 12 if "export_goat" in locals():
nuclear@38 13 imp.reload(export_goat)
nuclear@38 14
nuclear@38 15 import bpy
nuclear@38 16 from bpy_extras.io_utils import ExportHelper
nuclear@38 17
nuclear@38 18 class ExportGoat3D(bpy.types.Operator, ExportHelper):
nuclear@38 19 bl_idname = "export_scene.goat3d"
nuclear@38 20 bl_label = "Export Goat3D Scene"
nuclear@38 21 bl_options = {'PRESET'}
nuclear@38 22 filename_ext = ".goatsce"
nuclear@38 23 filter_glob = bpy.props.StringProperty(default="*.goatsce", options={'HIDDEN'})
nuclear@38 24
nuclear@38 25 def execute(self, ctx):
nuclear@38 26 from . import export_goat
nuclear@38 27 if not export_goat.export(self, ctx, self.filepath):
nuclear@38 28 return {'CANCELLED'}
nuclear@38 29 return {'FINISHED'}
nuclear@38 30
nuclear@38 31 def menu_func(self, ctx):
nuclear@38 32 self.layout.operator_context = 'INVOKE_DEFAULT'
nuclear@38 33 self.layout.operator(ExportGoat3D.bl_idname, text="Goat3D scene export (.goatsce)")
nuclear@38 34
nuclear@38 35 def register():
nuclear@38 36 bpy.utils.register_module(__name__)
nuclear@38 37 bpy.types.INFO_MT_file_export.append(menu_func)
nuclear@38 38
nuclear@38 39 def unregister():
nuclear@38 40 bpy.utils.unregister_module(__name__)
nuclear@38 41 bpy.types.INFO_MT_file_export.remove(menu_func)
nuclear@38 42
nuclear@38 43 if __name__ == "__main__":
nuclear@38 44 register()