mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Further clarification of type vs occurrence psets/qtos.
Previously even if you had a type selected it would still say occurrence.
This commit is contained in:
@@ -175,7 +175,7 @@ class BIM_PT_object_material(Panel):
|
||||
|
||||
if ObjectMaterialData.data["type_material"]:
|
||||
row = self.layout.row(align=True)
|
||||
row.label(text="Inherited Material: " + ObjectMaterialData.data["type_material"], icon="FILE_PARENT")
|
||||
row.label(text="Inherited Material: " + ObjectMaterialData.data["type_material"], icon="CON_CHILDOF")
|
||||
|
||||
if ObjectMaterialData.data["material_class"]:
|
||||
return self.draw_material_ui()
|
||||
|
||||
@@ -69,6 +69,7 @@ class ObjectPsetsData(Data):
|
||||
@classmethod
|
||||
def load(cls):
|
||||
cls.data = {
|
||||
"is_occurrence": cls.is_occurrence(),
|
||||
"psets": cls.psetqtos(tool.Ifc.get_entity(bpy.context.active_object), psets_only=True),
|
||||
"inherited_psets": cls.inherited_psets(),
|
||||
"pset_name": cls.pset_name(),
|
||||
@@ -76,6 +77,10 @@ class ObjectPsetsData(Data):
|
||||
}
|
||||
cls.is_loaded = True
|
||||
|
||||
@classmethod
|
||||
def is_occurrence(cls):
|
||||
return not tool.Ifc.get_entity(bpy.context.active_object).is_a("IfcTypeObject")
|
||||
|
||||
@classmethod
|
||||
def inherited_psets(cls):
|
||||
element = tool.Ifc.get_entity(bpy.context.active_object)
|
||||
@@ -126,11 +131,16 @@ class ObjectQtosData(Data):
|
||||
@classmethod
|
||||
def load(cls):
|
||||
cls.data = {
|
||||
"is_occurrence": cls.is_occurrence(),
|
||||
"qtos": cls.psetqtos(tool.Ifc.get_entity(bpy.context.active_object), qtos_only=True),
|
||||
"inherited_qsets": cls.inherited_qsets(),
|
||||
}
|
||||
cls.is_loaded = True
|
||||
|
||||
@classmethod
|
||||
def is_occurrence(cls):
|
||||
return not tool.Ifc.get_entity(bpy.context.active_object).is_a("IfcTypeObject")
|
||||
|
||||
@classmethod
|
||||
def inherited_qsets(cls):
|
||||
element = tool.Ifc.get_entity(bpy.context.active_object)
|
||||
|
||||
@@ -208,12 +208,15 @@ class BIM_PT_object_psets(Panel):
|
||||
draw_psetqto_ui(context, 0, {}, props, self.layout, "Object")
|
||||
|
||||
if ObjectPsetsData.data["psets"]:
|
||||
self.layout.label(text="Instance:")
|
||||
if ObjectPsetsData.data["is_occurrence"]:
|
||||
self.layout.label(text="Occurrence Properties:")
|
||||
else:
|
||||
self.layout.label(text="Type Properties:")
|
||||
for pset in ObjectPsetsData.data["psets"]:
|
||||
draw_psetqto_ui(context, pset["id"], pset, props, self.layout, "Object")
|
||||
|
||||
if ObjectPsetsData.data["inherited_psets"]:
|
||||
self.layout.label(text="Type:")
|
||||
self.layout.label(text="Inherited Type Properties:", icon="CON_CHILDOF")
|
||||
for pset in ObjectPsetsData.data["inherited_psets"]:
|
||||
draw_psetqto_ui(context, pset["id"], pset, props, self.layout, "Object", allow_removing=False)
|
||||
|
||||
@@ -252,12 +255,15 @@ class BIM_PT_object_qtos(Panel):
|
||||
draw_psetqto_ui(context, 0, {}, props, self.layout, "Object")
|
||||
|
||||
if ObjectQtosData.data["qtos"]:
|
||||
self.layout.label(text="Instance:")
|
||||
if ObjectQtosData.data["is_occurrence"]:
|
||||
self.layout.label(text="Occurrence Quantities:")
|
||||
else:
|
||||
self.layout.label(text="Type Quantities:")
|
||||
for qto in ObjectQtosData.data["qtos"]:
|
||||
draw_psetqto_ui(context, qto["id"], qto, props, self.layout, "Object")
|
||||
|
||||
if ObjectQtosData.data["inherited_qsets"]:
|
||||
self.layout.label(text="Type:")
|
||||
self.layout.label(text="Inherited Type Quantities:", icon="CON_CHILDOF")
|
||||
for qset in ObjectQtosData.data["inherited_qsets"]:
|
||||
draw_psetqto_ui(context, qset["id"], qset, props, self.layout, "Object", allow_removing=False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user