mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-20 20:22:09 +00:00
materials ui - fix bug when it was impossible to contract category
E.g. it was impossible to contract category "TEST" if there was also a material with name "TEST" (and it's category was expanded). It occurred due to a mixup of materials and categories in expanded_categories. Also changed is_expanded default value to False as it makes more sense (previous value didn't worked for materials and for categories you probably would want it to be False by default.
This commit is contained in:
@@ -123,7 +123,7 @@ class Material(PropertyGroup):
|
||||
name: StringProperty(name="Name")
|
||||
ifc_definition_id: IntProperty(name="IFC Definition ID")
|
||||
is_category: BoolProperty(name="Is Category", default=False)
|
||||
is_expanded: BoolProperty(name="Is Expanded", default=True)
|
||||
is_expanded: BoolProperty(name="Is Expanded", default=False)
|
||||
has_style: BoolProperty(name="Has Style", default=True)
|
||||
total_elements: IntProperty(name="Total Elements")
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ class Material(blenderbim.core.tool.Material):
|
||||
@classmethod
|
||||
def import_material_definitions(cls, material_type: str) -> None:
|
||||
props = bpy.context.scene.BIMMaterialProperties
|
||||
expanded_categories = {m.name for m in props.materials if m.is_expanded}
|
||||
expanded_categories = {m.name for m in props.materials if m.is_category and m.is_expanded}
|
||||
props.materials.clear()
|
||||
get_name = lambda x: x.Name or "Unnamed"
|
||||
if material_type == "IfcMaterialLayerSet":
|
||||
|
||||
Reference in New Issue
Block a user