Fix bug where material categories don't exist in IFC2X3

This commit is contained in:
Dion Moult
2022-07-18 10:29:32 +10:00
parent 28d15a6c9f
commit 3fd472549e
+1 -1
View File
@@ -65,7 +65,7 @@ class Material(blenderbim.core.tool.Material):
materials = sorted(tool.Ifc.get().by_type(material_type), key=get_name)
categories = {}
if material_type == "IfcMaterial":
[categories.setdefault(m.Category, []).append(m) for m in materials]
[categories.setdefault(getattr(m, "Category", "Uncategorised"), []).append(m) for m in materials]
for category, mats in categories.items():
cat = props.materials.add()
cat.name = category or ""