mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 04:00:08 +00:00
See #2938. Fix issue where unlinking didn't consider other users of the object's data or material.
This commit is contained in:
@@ -169,8 +169,11 @@ class UnlinkObject(bpy.types.Operator):
|
|||||||
for obj in objects:
|
for obj in objects:
|
||||||
if obj.BIMObjectProperties.ifc_definition_id:
|
if obj.BIMObjectProperties.ifc_definition_id:
|
||||||
IfcStore.unlink_element(obj=obj)
|
IfcStore.unlink_element(obj=obj)
|
||||||
|
if obj.data:
|
||||||
|
obj.data = obj.data.copy()
|
||||||
for material_slot in obj.material_slots:
|
for material_slot in obj.material_slots:
|
||||||
if material_slot.material:
|
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.style.unlink_style(tool.Ifc, tool.Style, obj=material_slot.material)
|
||||||
blenderbim.core.material.unlink_material(tool.Ifc, obj=material_slot.material)
|
blenderbim.core.material.unlink_material(tool.Ifc, obj=material_slot.material)
|
||||||
if "Ifc" in obj.name and "/" in obj.name:
|
if "Ifc" in obj.name and "/" in obj.name:
|
||||||
|
|||||||
Reference in New Issue
Block a user