mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-03 21:38:12 +00:00
Fix bug where spatial objects with representations didn't import correctly.
This commit is contained in:
@@ -1266,7 +1266,15 @@ class IfcImporter:
|
|||||||
if element.is_a("IfcProject"):
|
if element.is_a("IfcProject"):
|
||||||
return
|
return
|
||||||
elif element.GlobalId in self.spatial_structure_elements:
|
elif element.GlobalId in self.spatial_structure_elements:
|
||||||
return
|
if not obj.data:
|
||||||
|
return
|
||||||
|
# Since spatial structure elements are generated as empties, we'll replace it with the representation
|
||||||
|
spatial_obj = self.spatial_structure_elements[element.GlobalId]["blender_obj"]
|
||||||
|
spatial_collection = self.spatial_structure_elements[element.GlobalId]["blender"]
|
||||||
|
spatial_name = spatial_obj.name
|
||||||
|
spatial_collection.objects.link(obj)
|
||||||
|
bpy.data.objects.remove(spatial_obj)
|
||||||
|
obj.name = spatial_name
|
||||||
elif (
|
elif (
|
||||||
hasattr(element, "ContainedInStructure")
|
hasattr(element, "ContainedInStructure")
|
||||||
and element.ContainedInStructure
|
and element.ContainedInStructure
|
||||||
|
|||||||
Reference in New Issue
Block a user