mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
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
This commit is contained in:
parent
d2a50cada1
commit
312bd2a963
1 changed files with 7 additions and 2 deletions
|
@ -778,7 +778,10 @@ class CuraApplication(QtApplication):
|
||||||
# Ensure that the object is above the build platform
|
# Ensure that the object is above the build platform
|
||||||
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
|
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
|
||||||
if node.getBoundingBox():
|
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()
|
op.push()
|
||||||
|
|
||||||
## Reset all transformations on nodes with mesh data.
|
## Reset all transformations on nodes with mesh data.
|
||||||
|
@ -802,6 +805,8 @@ class CuraApplication(QtApplication):
|
||||||
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
|
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
|
||||||
if node.getBoundingBox():
|
if node.getBoundingBox():
|
||||||
center_y = node.getWorldPosition().y - node.getBoundingBox().bottom
|
center_y = node.getWorldPosition().y - node.getBoundingBox().bottom
|
||||||
|
else:
|
||||||
|
center_y = 0
|
||||||
op.addOperation(SetTransformOperation(node, Vector(0, center_y, 0), Quaternion(), Vector(1, 1, 1)))
|
op.addOperation(SetTransformOperation(node, Vector(0, center_y, 0), Quaternion(), Vector(1, 1, 1)))
|
||||||
op.push()
|
op.push()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue