diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-14 09:49:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-14 09:49:40 +0300 |
commit | d8e19001f08387edfe8e14c551166f1d43627426 (patch) | |
tree | 563bfeb7f205924b561ed95840c345328f46afd6 /space_view3d_math_vis | |
parent | 66fe0a63528b8654700d62ca3e6701010159cadc (diff) |
math_vis: remove use of register_module
Diffstat (limited to 'space_view3d_math_vis')
-rw-r--r-- | space_view3d_math_vis/__init__.py | 23 |
1 files changed, 21 insertions, 2 deletions
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) |