fix: added proper register/unregister

This commit is contained in:
Gaia Clary 2016-12-01 01:12:24 +01:00
parent cdf67517e0
commit 26b6c193ee
1 changed files with 5 additions and 4 deletions

View File

@ -199,12 +199,10 @@ def register():
import console_python
console_python.execute.hooks.append((console_hook, ()))
bpy.utils.register_module(__name__)
if not 'MathVisStateProp' in dir(bpy.types.WindowManager):
bpy.types.Scene.MathVisProp = PointerProperty(type=MathVisProp)
bpy.types.WindowManager.MathVisStateProp = CollectionProperty(type=MathVisStateProp)
bpy.types.Scene.MathVisProp = PointerProperty(type=MathVisProp)
bpy.types.WindowManager.MathVisStateProp = CollectionProperty(type=MathVisStateProp)
bpy.types.CONSOLE_MT_console.prepend(menu_func_cleanup)
def unregister():
context = bpy.context
var_states = get_var_states()
@ -214,4 +212,7 @@ def unregister():
import console_python
console_python.execute.hooks.remove((console_hook, ()))
bpy.types.CONSOLE_MT_console.remove(menu_func_cleanup)
del bpy.types.Scene.MathVisProp
del bpy.types.WindowManager.MathVisStateProp
bpy.utils.unregister_module(__name__)