mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Skip applying scale to geometry on duplicate #5663
This commit is contained in:
@@ -947,7 +947,9 @@ class OverrideDuplicateMove(bpy.types.Operator):
|
||||
|
||||
# Prior to duplicating, sync the object placement to make decomposition recreation more stable.
|
||||
if tool.Ifc.is_moved(obj):
|
||||
bonsai.core.geometry.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj)
|
||||
bonsai.core.geometry.edit_object_placement(
|
||||
tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj, apply_scale=False
|
||||
)
|
||||
|
||||
new_obj = obj.copy()
|
||||
temp_data = None
|
||||
|
||||
@@ -26,7 +26,11 @@ if TYPE_CHECKING:
|
||||
|
||||
|
||||
def edit_object_placement(
|
||||
ifc: tool.Ifc, geometry: tool.Geometry, surveyor: tool.Surveyor, obj: Optional[bpy.types.Object] = None
|
||||
ifc: tool.Ifc,
|
||||
geometry: tool.Geometry,
|
||||
surveyor: tool.Surveyor,
|
||||
obj: Optional[bpy.types.Object] = None,
|
||||
apply_scale: bool = True,
|
||||
) -> None:
|
||||
"""Sync current object placement.
|
||||
|
||||
@@ -38,7 +42,8 @@ def edit_object_placement(
|
||||
if not element:
|
||||
return
|
||||
geometry.clear_cache(element)
|
||||
geometry.clear_scale(obj)
|
||||
if apply_scale:
|
||||
geometry.clear_scale(obj)
|
||||
geometry.get_blender_offset_type(obj)
|
||||
ifc.run("geometry.edit_object_placement", product=element, matrix=surveyor.get_absolute_matrix(obj))
|
||||
geometry.record_object_position(obj)
|
||||
|
||||
Reference in New Issue
Block a user