]> git.tdb.fi Git - libs/gl.git/commitdiff
Adapt to changes in bpy API
authorMikko Rasa <tdb@tdb.fi>
Thu, 7 Apr 2011 14:28:04 +0000 (14:28 +0000)
committerMikko Rasa <tdb@tdb.fi>
Thu, 7 Apr 2011 14:28:04 +0000 (14:28 +0000)
blender/io_mesh_mspgl/__init__.py

index 5ff3b4bc93e30cf635cb7d31e26bf87af2394df7..5fa70c200c19e518bbb7825da0683326583b2207 100644 (file)
@@ -1,8 +1,21 @@
+bl_info = {
+       "name": "Msp GL format",
+       "author": "Mikko Rasa",
+       "location": "File > Export",
+       "description": "Export Msp GL meshes and objects",
+       "category": "Import-Export" }
+
+if "bpy" in locals():
+       import imp
+       for sub in "export_mspgl", "mesh", "util":
+               if sub in locals():
+                       imp.reload(locals()[sub])
+
 import bpy
 from io_utils import ExportHelper
 
 class ExportMspGL(bpy.types.Operator, ExportHelper):
-       bl_idname = "export.mspgl"
+       bl_idname = "export_mesh.mspgl"
        bl_label = "Export Msp GL data"
 
        filename_ext = ".mesh"
@@ -39,7 +52,14 @@ def menu_func_export(self, context):
        self.layout.operator(ExportMspGL.bl_idname, text="Msp GL")
 
 def register():
+       bpy.utils.register_module(__name__)
+
        bpy.types.INFO_MT_file_export.append(menu_func_export)
 
+def unregister():
+       bpy.utils.unregister_module(__name__)
+
+       bpy.types.INFO_MT_file_export.remove(menu_func_export)
+
 if __name__=="__main__":
        register()