From 366ef4ca06818eb9bc6d33b1a9b98666c6ba650e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Sun, 31 Oct 2021 17:21:51 +0100 Subject: [PATCH] Fix undo and redo for support blocker The translate wasn't done via an operation, so it wouldn't go back to the same state after an undo / redo Fixes #10648 --- plugins/SupportEraser/SupportEraser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/SupportEraser/SupportEraser.py b/plugins/SupportEraser/SupportEraser.py index 35f597dcc5..b64a0f4eed 100644 --- a/plugins/SupportEraser/SupportEraser.py +++ b/plugins/SupportEraser/SupportEraser.py @@ -6,6 +6,7 @@ from PyQt5.QtWidgets import QApplication from UM.Application import Application from UM.Math.Vector import Vector +from UM.Operations.TranslateOperation import TranslateOperation from UM.Tool import Tool from UM.Event import Event, MouseEvent from UM.Mesh.MeshBuilder import MeshBuilder @@ -120,8 +121,8 @@ class SupportEraser(Tool): # First add node to the scene at the correct position/scale, before parenting, so the eraser mesh does not get scaled with the parent op.addOperation(AddSceneNodeOperation(node, self._controller.getScene().getRoot())) op.addOperation(SetParentOperation(node, parent)) + op.addOperation(TranslateOperation(node, position, set_position = True)) op.push() - node.setPosition(position, CuraSceneNode.TransformSpace.World) CuraApplication.getInstance().getController().getScene().sceneChanged.emit(node)