mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix bug where material / style UI was showing without a loaded IFC
This commit is contained in:
@@ -10,6 +10,10 @@ class BIM_PT_material(Panel):
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "material"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return IfcStore.get_file()
|
||||
|
||||
def draw(self, context):
|
||||
row = self.layout.row()
|
||||
if bool(context.active_object.active_material.BIMObjectProperties.ifc_definition_id):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from bpy.types import Panel
|
||||
from blenderbim.bim.ifc import IfcStore
|
||||
|
||||
|
||||
class BIM_PT_style(Panel):
|
||||
@@ -10,7 +11,11 @@ class BIM_PT_style(Panel):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return context.active_object is not None and context.active_object.active_material is not None
|
||||
return (
|
||||
IfcStore.get_file()
|
||||
and context.active_object is not None
|
||||
and context.active_object.active_material is not None
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
props = context.active_object.active_material.BIMMaterialProperties
|
||||
|
||||
Reference in New Issue
Block a user