Fix bug duplicating edited object

It was losing original object representation on project save as it wasn't marked as edited.
This commit is contained in:
Andrej730
2024-10-31 15:42:52 +05:00
parent 64b3101cef
commit b39f96e2ee
2 changed files with 8 additions and 2 deletions
@@ -954,6 +954,12 @@ class OverrideDuplicateMove(bpy.types.Operator):
new_obj = obj.copy()
temp_data = None
# Currently for optimization we do not apply pending changes (scale or changed .data)
# to the original and duplicated objects.
# Keep new object edited if original is.
if tool.Ifc.is_edited(obj, ignore_scale=True):
tool.Ifc.edit(new_obj)
if obj.data and not linked_non_ifc_object:
# assure root.copy_class won't replace the previous mesh globally
temp_data = obj.data.copy()
+2 -2
View File
@@ -66,8 +66,8 @@ class Ifc(bonsai.core.tool.Ifc):
return IfcStore.get_file().schema
@classmethod
def is_edited(cls, obj: bpy.types.Object) -> bool:
return tool.Geometry.is_scaled(obj) or obj in IfcStore.edited_objs
def is_edited(cls, obj: bpy.types.Object, *, ignore_scale: bool = False) -> bool:
return (not ignore_scale and tool.Geometry.is_scaled(obj)) or obj in IfcStore.edited_objs
@classmethod
def is_moved(cls, obj: bpy.types.Object) -> bool: