mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-30 12:09:51 +00:00
Fix registration bug that created hundreds of workspaces due to continuous triggering of the depsgraph_update.
Use an is_registering check to only run the on_register once. Rename setDefaultProperties to load_post to better reflect what handler it is. Unregister our custom scene panels upon addon activation. Move aprops getting to tool.Blender because it is a bit complex. Also, aprops may not be setup until load_post is called, so the len() check protects against that.
This commit is contained in:
@@ -167,8 +167,7 @@ class BIM_PT_drawings(Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
aprops = tool.Blender.get_area_properties(context)
|
||||
return (aprops.tab == "DRAWINGS" or context.area.spaces.active.search_filter) and tool.Ifc.get()
|
||||
return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get()
|
||||
|
||||
def draw(self, context):
|
||||
if not DrawingsData.is_loaded:
|
||||
@@ -236,8 +235,7 @@ class BIM_PT_schedules(Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
aprops = tool.Blender.get_area_properties(context)
|
||||
return (aprops.tab == "DRAWINGS" or context.area.spaces.active.search_filter) and tool.Ifc.get()
|
||||
return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get()
|
||||
|
||||
def draw(self, context):
|
||||
if not DocumentsData.is_loaded:
|
||||
@@ -292,8 +290,7 @@ class BIM_PT_references(Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
aprops = tool.Blender.get_area_properties(context)
|
||||
return (aprops.tab == "DRAWINGS" or context.area.spaces.active.search_filter) and tool.Ifc.get()
|
||||
return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get()
|
||||
|
||||
def draw(self, context):
|
||||
if not DocumentsData.is_loaded:
|
||||
@@ -337,8 +334,7 @@ class BIM_PT_sheets(Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
aprops = tool.Blender.get_area_properties(context)
|
||||
return (aprops.tab == "DRAWINGS" or context.area.spaces.active.search_filter) and tool.Ifc.get()
|
||||
return tool.Blender.is_tab(context, "DRAWINGS") and tool.Ifc.get()
|
||||
|
||||
def draw(self, context):
|
||||
if not SheetsData.is_loaded:
|
||||
|
||||
Reference in New Issue
Block a user