[Bf-extensions-cvs] [d8e19001] master: math_vis: remove use of register_module

Campbell Barton noreply at git.blender.org
Sat Jul 14 08:50:03 CEST 2018


Commit: d8e19001f08387edfe8e14c551166f1d43627426
Author: Campbell Barton
Date:   Sat Jul 14 08:49:40 2018 +0200
Branches: master
https://developer.blender.org/rBAd8e19001f08387edfe8e14c551166f1d43627426

math_vis: remove use of register_module

===================================================================

M	space_view3d_math_vis/__init__.py

===================================================================

diff --git a/space_view3d_math_vis/__init__.py b/space_view3d_math_vis/__init__.py
index df220136..2683c754 100644
--- a/space_view3d_math_vis/__init__.py
+++ b/space_view3d_math_vis/__init__.py
@@ -242,18 +242,36 @@ class MathVis(PropertyGroup):
             )
 
 
+classes = (
+    PanelConsoleVars,
+    DeleteVar,
+    ToggleDisplay,
+    ToggleLock,
+    ToggleMatrixBBoxDisplay,
+    CleanupConsole,
+    MathVisStateProp,
+    MathVisVarList,
+    MathVis,
+)
+
+
 def register():
+    from bpy.utils import register_class
+
     draw.callback_enable()
 
     import console_python
     console_python.execute.hooks.append((console_hook, ()))
-    bpy.utils.register_module(__name__)
+    for cls in classes:
+        bpy.utils.register_class(cls)
     bpy.types.WindowManager.MathVisProp = PointerProperty(type=MathVis)
     bpy.types.WindowManager.MathVisStatePropList = CollectionProperty(type=MathVisStateProp)
     bpy.types.CONSOLE_MT_console.prepend(menu_func_cleanup)
 
 
 def unregister():
+    from bpy.utils import unregister_class
+
     draw.callback_disable()
 
     import console_python
@@ -262,4 +280,5 @@ def unregister():
     del bpy.types.WindowManager.MathVisProp
     del bpy.types.WindowManager.MathVisStatePropList
 
-    bpy.utils.unregister_module(__name__)
+    for cls in classes:
+        unregister_class(cls)



More information about the Bf-extensions-cvs mailing list