Fix #1998. Fix bug where colours don't show if styling is applied to the mapped item instead of the actual representation item.

This commit is contained in:
Dion Moult
2022-01-25 13:40:40 +11:00
parent 28e6bb9e3d
commit 3222c9ce99
+3 -4
View File
@@ -109,7 +109,7 @@ class MaterialCreator:
def parse_representation(self, representation):
has_parsed = False
representation_items = self.resolve_mapped_representation_items(representation)
representation_items = self.resolve_all_representation_items(representation)
for item in representation_items:
if self.parse_representation_item(item):
has_parsed = True
@@ -143,13 +143,12 @@ class MaterialCreator:
]
self.mesh.polygons.foreach_set("material_index", material_index)
def resolve_mapped_representation_items(self, representation):
def resolve_all_representation_items(self, representation):
items = []
for item in representation.Items:
if item.is_a("IfcMappedItem"):
items.extend(item.MappingSource.MappedRepresentation.Items)
else:
items.append(item)
items.append(item)
return items