Merge pull request #8633 from Ultimaker/CURA-7796_fix_merge_models

Reset the entire transformation when merging
This commit is contained in:
Konstantinos Karmas 2020-10-27 14:40:34 +01:00 committed by GitHub
commit 3dc1e7a0fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1522,13 +1522,10 @@ class CuraApplication(QtApplication):
# Move each node to the same position.
for mesh, node in zip(meshes, group_node.getChildren()):
transformation = node.getLocalTransformation()
transformation.setTranslation(zero_translation)
transformed_mesh = mesh.getTransformed(transformation)
node.setTransformation(Matrix())
# Align the object around its zero position
# and also apply the offset to center it inside the group.
node.setPosition(-transformed_mesh.getZeroPosition() - offset)
node.setPosition(-mesh.getZeroPosition() - offset)
# Use the previously found center of the group bounding box as the new location of the group
group_node.setPosition(group_node.getBoundingBox().center)