Show all available styles editing material styles #5525

Previously it would fail e.g. if IfcFillAreaStyle was already assigned to the material but UI was showing errors because enum items contained only surface styles.
This commit is contained in:
Andrej730
2024-10-04 10:42:35 +05:00
parent 7b0a792ff7
commit 0e6479b090
@@ -91,8 +91,12 @@ class MaterialsData:
return results
@classmethod
def styles(cls):
return [(str(s.id()), s.Name or "Unnamed", "") for s in tool.Ifc.get().by_type("IfcSurfaceStyle") if s.Name]
def styles(cls) -> list[tuple[str, str, str]]:
return [
(str(s.id()), style_name or "Unnamed", "")
for s in tool.Ifc.get().by_type("IfcPresentationStyle")
if (style_name := s.Name)
]
@classmethod
def active_styles(cls):