From: Mikko Rasa Date: Thu, 7 Apr 2011 14:28:04 +0000 (+0000) Subject: Adapt to changes in bpy API X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=50247d85f6bca72b9a53fd97ff8f31e006e8582d;p=libs%2Fgl.git Adapt to changes in bpy API --- diff --git a/blender/io_mesh_mspgl/__init__.py b/blender/io_mesh_mspgl/__init__.py index 5ff3b4bc..5fa70c20 100644 --- a/blender/io_mesh_mspgl/__init__.py +++ b/blender/io_mesh_mspgl/__init__.py @@ -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()