From 9b3625717fb4ac1f590fa598b1acb3e698eb1667 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 5 Apr 2023 20:58:10 +1000 Subject: [PATCH] See #2938. Fix issue where unlinking didn't consider other users of the object's data or material. --- src/blenderbim/blenderbim/bim/module/root/operator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/blenderbim/blenderbim/bim/module/root/operator.py b/src/blenderbim/blenderbim/bim/module/root/operator.py index 213396c4fb..2b5bfd2248 100644 --- a/src/blenderbim/blenderbim/bim/module/root/operator.py +++ b/src/blenderbim/blenderbim/bim/module/root/operator.py @@ -169,8 +169,11 @@ class UnlinkObject(bpy.types.Operator): for obj in objects: if obj.BIMObjectProperties.ifc_definition_id: IfcStore.unlink_element(obj=obj) + if obj.data: + obj.data = obj.data.copy() for material_slot in obj.material_slots: if material_slot.material: + material_slot.material = material_slot.material.copy() blenderbim.core.style.unlink_style(tool.Ifc, tool.Style, obj=material_slot.material) blenderbim.core.material.unlink_material(tool.Ifc, obj=material_slot.material) if "Ifc" in obj.name and "/" in obj.name: