mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Hide object related panels when there is no object active
This commit is contained in:
@@ -837,7 +837,12 @@ class BIM_PT_tab_object_metadata(Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return tool.Blender.is_tab(context, "OBJECT") and tool.Ifc.get()
|
return (
|
||||||
|
tool.Blender.is_tab(context, "OBJECT")
|
||||||
|
and tool.Ifc.get()
|
||||||
|
and (obj := context.active_object)
|
||||||
|
and tool.Ifc.get_entity(obj)
|
||||||
|
)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -852,7 +857,12 @@ class BIM_PT_tab_placement(Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return tool.Blender.is_tab(context, "GEOMETRY") and tool.Ifc.get()
|
return (
|
||||||
|
tool.Blender.is_tab(context, "GEOMETRY")
|
||||||
|
and tool.Ifc.get()
|
||||||
|
and (obj := context.active_object)
|
||||||
|
and tool.Ifc.get_entity(obj)
|
||||||
|
)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -867,7 +877,12 @@ class BIM_PT_tab_representations(Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return tool.Blender.is_tab(context, "GEOMETRY") and tool.Ifc.get()
|
return (
|
||||||
|
tool.Blender.is_tab(context, "GEOMETRY")
|
||||||
|
and tool.Ifc.get()
|
||||||
|
and (obj := context.active_object)
|
||||||
|
and tool.Ifc.get_entity(obj)
|
||||||
|
)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -899,7 +914,12 @@ class BIM_PT_tab_parametric_geometry(Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return tool.Blender.is_tab(context, "GEOMETRY") and tool.Ifc.get()
|
return (
|
||||||
|
tool.Blender.is_tab(context, "GEOMETRY")
|
||||||
|
and tool.Ifc.get()
|
||||||
|
and (obj := context.active_object)
|
||||||
|
and tool.Ifc.get_entity(obj)
|
||||||
|
)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
@@ -914,7 +934,12 @@ class BIM_PT_tab_object_materials(Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return tool.Blender.is_tab(context, "GEOMETRY") and tool.Ifc.get()
|
return (
|
||||||
|
tool.Blender.is_tab(context, "GEOMETRY")
|
||||||
|
and tool.Ifc.get()
|
||||||
|
and (obj := context.active_object)
|
||||||
|
and tool.Ifc.get_entity(obj)
|
||||||
|
)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user