mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +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):
|
||||
bl_label = "Style"
|
||||
bl_idname = "BIM_PT_style"
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "material"
|
||||
|
||||
@classmethod
|
||||
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):
|
||||
# NOTE: this UI is needed only to indicate whether blender material is linked to IFC
|
||||
|
||||
Reference in New Issue
Block a user