Fix error when displaying a selected but inactive object's properties with the pin feature

This commit is contained in:
Gorgious
2021-09-27 12:51:43 +02:00
parent 024a306a36
commit dbac865a39
12 changed files with 24 additions and 0 deletions
@@ -31,6 +31,8 @@ class BIM_PT_aggregate(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
props = context.active_object.BIMObjectProperties
if not props.ifc_definition_id:
return False
@@ -92,6 +92,8 @@ class BIM_PT_object_attributes(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
if not IfcStore.get_element(context.active_object.BIMObjectProperties.ifc_definition_id):
return False
return bool(context.active_object.BIMObjectProperties.ifc_definition_id)
@@ -89,6 +89,8 @@ class BIM_PT_classification_references(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
if not IfcStore.get_element(context.active_object.BIMObjectProperties.ifc_definition_id):
return False
return bool(context.active_object.BIMObjectProperties.ifc_definition_id)
@@ -76,6 +76,8 @@ class BIM_PT_object_constraints(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
if not IfcStore.get_element(context.active_object.BIMObjectProperties.ifc_definition_id):
return False
return bool(context.active_object.BIMObjectProperties.ifc_definition_id)
@@ -80,6 +80,8 @@ class BIM_PT_object_documents(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
if not IfcStore.get_element(context.active_object.BIMObjectProperties.ifc_definition_id):
return False
return bool(context.active_object.BIMObjectProperties.ifc_definition_id)
@@ -32,6 +32,8 @@ class BIM_PT_representations(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
if not IfcStore.get_element(context.active_object.BIMObjectProperties.ifc_definition_id):
return False
return IfcStore.get_file()
@@ -77,6 +77,8 @@ class BIM_PT_object_groups(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
return IfcStore.get_file() and context.active_object.BIMObjectProperties.ifc_definition_id
def draw(self, context):
@@ -52,6 +52,8 @@ class BIM_PT_object_material(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
props = context.active_object.BIMObjectProperties
if not props.ifc_definition_id:
return False
@@ -32,6 +32,8 @@ class BIM_PT_class(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
return IfcStore.get_file()
def draw(self, context):
@@ -77,6 +77,8 @@ class BIM_PT_object_systems(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
return IfcStore.get_file() and context.active_object.BIMObjectProperties.ifc_definition_id
def draw(self, context):
@@ -31,6 +31,8 @@ class BIM_PT_type(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
props = context.active_object.BIMObjectProperties
if not props.ifc_definition_id:
return False
@@ -32,6 +32,8 @@ class BIM_PT_voids(Panel):
@classmethod
def poll(cls, context):
if not context.active_object:
return False
if not IfcStore.get_element(context.active_object.BIMObjectProperties.ifc_definition_id):
return False
return IfcStore.get_file()