mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
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:
@@ -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()
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user