mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 04:59:05 +08:00
Fix for CURA-4111
When centering a scene node, TranslateOperation is used in lieu of SetTransformOperation, to avoid combinations of mirror operations behaving like rotation operations. Instead, any given node is simply translated to 0,0,0.
This commit is contained in:
parent
7eb507484b
commit
e0c2a9e4c7
@ -13,6 +13,7 @@ from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator
|
||||
from UM.Operations.GroupedOperation import GroupedOperation
|
||||
from UM.Operations.RemoveSceneNodeOperation import RemoveSceneNodeOperation
|
||||
from UM.Operations.SetTransformOperation import SetTransformOperation
|
||||
from UM.Operations.TranslateOperation import TranslateOperation
|
||||
|
||||
from cura.SetParentOperation import SetParentOperation
|
||||
from cura.MultiplyObjectsJob import MultiplyObjectsJob
|
||||
@ -54,7 +55,11 @@ class CuraActions(QObject):
|
||||
while current_node.getParent() and current_node.getParent().callDecoration("isGroup"):
|
||||
current_node = current_node.getParent()
|
||||
|
||||
center_operation = SetTransformOperation(current_node, Vector())
|
||||
# This was formerly done with SetTransformOperation but because of
|
||||
# unpredictable matrix deconstruction it was possible that mirrors
|
||||
# could manifest as rotations. Centering is therefore done by
|
||||
# moving the node to negative whatever its position is:
|
||||
center_operation = TranslateOperation(current_node, -current_node._position)
|
||||
operation.addOperation(center_operation)
|
||||
operation.push()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user