toggle decorations onload

fix #1237
This commit is contained in:
QwiglyDee
2021-01-06 04:01:03 +07:00
parent 02b01b2a44
commit cef3b9537a
2 changed files with 10 additions and 0 deletions
@@ -366,6 +366,7 @@ if bpy is not None:
module_spatial.register()
module_unit.register()
bpy.app.handlers.depsgraph_update_pre.append(operator.depsgraph_update_pre_handler)
bpy.app.handlers.load_post.append(prop.toggleDecorationsOnLoad)
def unregister():
for cls in reversed(classes):
@@ -353,6 +353,15 @@ def toggleDecorations(self, context):
decoration.DecorationsHandler.uninstall()
@persistent
def toggleDecorationsOnLoad(*args):
toggle = bpy.context.scene.DocProperties.should_draw_decorations
if toggle:
decoration.DecorationsHandler.install(bpy.context)
else:
decoration.DecorationsHandler.uninstall()
def getScenarios(self, context):
global scenarios_enum
if len(scenarios_enum) < 1: