[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1572] trunk/py/scripts/addons/ io_export_anim_mesh_xna/__init__.py: fix for xna with api updates.

Campbell Barton ideasman42 at gmail.com
Fri Feb 11 03:43:52 CET 2011


Revision: 1572
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1572
Author:   campbellbarton
Date:     2011-02-11 02:43:51 +0000 (Fri, 11 Feb 2011)
Log Message:
-----------
fix for xna with api updates. note, lazy operator registration isnt all that nice.
would prefer operators always get registered with the addon rather then when the menu opens.

Modified Paths:
--------------
    trunk/py/scripts/addons/io_export_anim_mesh_xna/__init__.py

Modified: trunk/py/scripts/addons/io_export_anim_mesh_xna/__init__.py
===================================================================
--- trunk/py/scripts/addons/io_export_anim_mesh_xna/__init__.py	2011-02-11 02:19:03 UTC (rev 1571)
+++ trunk/py/scripts/addons/io_export_anim_mesh_xna/__init__.py	2011-02-11 02:43:51 UTC (rev 1572)
@@ -56,6 +56,9 @@
 def menu_export_fbx_takes(self, context):
     from . import export_xna
     import os
+    if not export_xna.ExportFBXtakes.is_registered():
+        bpy.utils.register_module(__name__)
+
     # get the current action name
     currentAction = ""
     for arm_obj in bpy.context.scene.objects:
@@ -70,14 +73,15 @@
 def menu_export_fbx_animated(self, context):
     from . import export_xna
     import os
+    if not export_xna.ExportFBXanimated.is_registered():
+        bpy.utils.register_module(__name__)
+
     default_path = os.path.splitext(bpy.data.filepath)[0] + ".fbx"
     self.layout.operator(export_xna.ExportFBXanimated.bl_idname, text="XNA FBX Animated Model (.fbx)").filepath = default_path
 
 
 # Add references to all scripts invoked by this class
 def register():
-    bpy.utils.register_module(__name__)
-
     bpy.types.INFO_MT_file_export.append(menu_export_fbx_animated)
     bpy.types.INFO_MT_file_export.append(menu_export_fbx_model)
     bpy.types.INFO_MT_file_export.append(menu_export_fbx_takes)



More information about the Bf-extensions-cvs mailing list