mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
bim.add_representation - clean up orphaned temporary meshes
This commit is contained in:
@@ -175,6 +175,8 @@ class AddRepresentation(bpy.types.Operator, Operator):
|
|||||||
)
|
)
|
||||||
return {"FINISH"}
|
return {"FINISH"}
|
||||||
|
|
||||||
|
# NOTE: `data` is temporary data generated to add a representation.
|
||||||
|
data: bpy.types.Mesh
|
||||||
if conversion_method == "OUTLINE":
|
if conversion_method == "OUTLINE":
|
||||||
if ifc_context.ContextType == "Plan":
|
if ifc_context.ContextType == "Plan":
|
||||||
data = tool.Geometry.generate_outline_mesh(obj, axis="+Z")
|
data = tool.Geometry.generate_outline_mesh(obj, axis="+Z")
|
||||||
@@ -225,6 +227,7 @@ class AddRepresentation(bpy.types.Operator, Operator):
|
|||||||
# Object might be recreated, need to set it as active again.
|
# Object might be recreated, need to set it as active again.
|
||||||
if context.active_object != obj:
|
if context.active_object != obj:
|
||||||
tool.Blender.set_active_object(obj)
|
tool.Blender.set_active_object(obj)
|
||||||
|
bpy.data.meshes.remove(data)
|
||||||
except core.IncompatibleRepresentationError:
|
except core.IncompatibleRepresentationError:
|
||||||
if obj.data != original_data:
|
if obj.data != original_data:
|
||||||
tool.Geometry.change_object_data(obj, original_data, is_global=True)
|
tool.Geometry.change_object_data(obj, original_data, is_global=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user