Fix bug where loading drawings didn't correctly link shared meshes (e.g. from a type of an annotation)

This commit is contained in:
Dion Moult
2024-03-30 15:05:49 +11:00
parent 13b845df92
commit 2037a5a46b
2 changed files with 4 additions and 0 deletions
@@ -1164,6 +1164,9 @@ class IfcImporter:
return obj
def load_existing_meshes(self) -> None:
self.meshes.update({m.name: m for m in bpy.data.meshes})
def get_representation_item_material_name(self, item):
if not item.StyledByItem:
return
@@ -607,6 +607,7 @@ class Drawing(blenderbim.core.tool.Drawing):
ifc_importer.file = tool.Ifc.get()
ifc_importer.calculate_unit_scale()
ifc_importer.process_context_filter()
ifc_importer.load_existing_meshes()
ifc_importer.material_creator.load_existing_materials()
ifc_importer.create_generic_elements(elements)
for obj in ifc_importer.added_data.values():