mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 22:43:41 +00:00
Fix for console errors in a0e5d350b when no material active
This commit is contained in:
@@ -293,13 +293,13 @@ class BIM_UL_styles(UIList):
|
|||||||
class BIM_PT_style(Panel):
|
class BIM_PT_style(Panel):
|
||||||
bl_label = "Style"
|
bl_label = "Style"
|
||||||
bl_idname = "BIM_PT_style"
|
bl_idname = "BIM_PT_style"
|
||||||
bl_space_type = 'PROPERTIES'
|
bl_space_type = "PROPERTIES"
|
||||||
bl_region_type = 'WINDOW'
|
bl_region_type = "WINDOW"
|
||||||
bl_context = "material"
|
bl_context = "material"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return bool(tool.Ifc.get() and context.material.BIMMaterialProperties.ifc_style_id)
|
return bool(tool.Ifc.get() and (material := context.material) and material.BIMMaterialProperties.ifc_style_id)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
# NOTE: this UI is needed only to indicate whether blender material is linked to IFC
|
# NOTE: this UI is needed only to indicate whether blender material is linked to IFC
|
||||||
|
|||||||
Reference in New Issue
Block a user