diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 892440cba0..32c5191c7c 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -693,17 +693,17 @@ class CuraApplication(QtApplication): continue # Node that doesnt have a mesh and is not a group. if node.getParent() and node.getParent().callDecoration("isGroup"): continue # Grouped nodes don't need resetting as their parent (the group) is resetted) - nodes.append(node) if nodes: op = GroupedOperation() for node in nodes: + # Ensure that the object is above the build platform node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator) op.addOperation(SetTransformOperation(node, Vector(0, node.getWorldPosition().y - node.getBoundingBox().bottom, 0))) op.push() - - ## Reset all transformations on nodes with mesh data. + + ## Reset all transformations on nodes with mesh data. @pyqtSlot() def resetAll(self): Logger.log("i", "Resetting all scene transformations") @@ -719,15 +719,17 @@ class CuraApplication(QtApplication): if nodes: op = GroupedOperation() - for node in nodes: # Ensure that the object is above the build platform node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator) - - op.addOperation(SetTransformOperation(node, Vector(0, node.getMeshData().getCenterPosition().y, 0), Quaternion(), Vector(1, 1, 1))) - + center_y = 0 + if node.callDecoration("isGroup"): + center_y = node.getWorldPosition().y - node.getBoundingBox().bottom + else: + center_y = node.getMeshData().getCenterPosition().y + op.addOperation(SetTransformOperation(node, Vector(0, center_y, 0), Quaternion(), Vector(1, 1, 1))) op.push() - + ## Reload all mesh data on the screen from file. @pyqtSlot() def reloadAll(self):