mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 11:18:18 +00:00
Fix bug where Blender name wouldn't match IFC Name when reassigning class. See #1902.
This commit is contained in:
@@ -70,7 +70,7 @@ class Loader:
|
|||||||
surface.InnerBoundaries = ()
|
surface.InnerBoundaries = ()
|
||||||
shape = ifcopenshell.geom.create_shape(self.settings, surface)
|
shape = ifcopenshell.geom.create_shape(self.settings, surface)
|
||||||
mesh = self.ifc_importer.create_mesh(None, shape)
|
mesh = self.ifc_importer.create_mesh(None, shape)
|
||||||
obj = bpy.data.objects.new(f"{boundary.is_a()}/{boundary_id}", mesh)
|
obj = bpy.data.objects.new(f"{boundary.is_a()}/{boundary.Name}", mesh)
|
||||||
obj.matrix_world = blender_space.matrix_world
|
obj.matrix_world = blender_space.matrix_world
|
||||||
boundaries_collection = get_boundaries_collection(blender_space)
|
boundaries_collection = get_boundaries_collection(blender_space)
|
||||||
boundaries_collection.objects.link(obj)
|
boundaries_collection.objects.link(obj)
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class ReassignClass(bpy.types.Operator):
|
|||||||
"predefined_type": predefined_type,
|
"predefined_type": predefined_type,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
obj.name = "{}/{}".format(product.is_a(), "/".join(obj.name.split("/")[1:]))
|
obj.name = "{}/{}".format(product.is_a(), getattr(product, "Name", "None"))
|
||||||
IfcStore.link_element(product, obj)
|
IfcStore.link_element(product, obj)
|
||||||
obj.BIMObjectProperties.is_reassigning_class = False
|
obj.BIMObjectProperties.is_reassigning_class = False
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|||||||
Reference in New Issue
Block a user