From d8e19001f08387edfe8e14c551166f1d43627426 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 14 Jul 2018 08:49:40 +0200 Subject: math_vis: remove use of register_module --- space_view3d_math_vis/__init__.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'space_view3d_math_vis') 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) -- cgit v1.2.3