From 312bd2a963af8ac732849528820bd457814986b9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 18 Nov 2016 13:28:14 +0100 Subject: [PATCH] Resetting now simply resets everything to 0 if there is no bounding box For the current usage, this won't change anything, but it's more future proof CURA-2925 --- cura/CuraApplication.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 5c186fbe75..5ac414f00d 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -778,7 +778,10 @@ class CuraApplication(QtApplication): # Ensure that the object is above the build platform node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator) if node.getBoundingBox(): - op.addOperation(SetTransformOperation(node, Vector(0, node.getWorldPosition().y - node.getBoundingBox().bottom, 0))) + center_y = node.getWorldPosition().y - node.getBoundingBox().bottom + else: + center_y = 0 + op.addOperation(SetTransformOperation(node, Vector(0, center_y, 0))) op.push() ## Reset all transformations on nodes with mesh data. @@ -802,7 +805,9 @@ class CuraApplication(QtApplication): node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator) if node.getBoundingBox(): center_y = node.getWorldPosition().y - node.getBoundingBox().bottom - op.addOperation(SetTransformOperation(node, Vector(0, center_y, 0), Quaternion(), Vector(1, 1, 1))) + else: + center_y = 0 + 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.