mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
CURA-4269 small code improvement for z-offset in project loading
This commit is contained in:
parent
d2de039371
commit
e7e24caf97
1 changed files with 4 additions and 3 deletions
|
@ -204,10 +204,11 @@ class ThreeMFReader(MeshReader):
|
|||
# Pre multiply the transformation with the loaded transformation, so the data is handled correctly.
|
||||
um_node.setTransformation(um_node.getLocalTransformation().preMultiply(transformation_matrix))
|
||||
|
||||
# If the object in a saved project is below the bed, keep it that way
|
||||
if um_node.getMeshData() != None and um_node.getMeshData().getExtents(um_node.getWorldTransformation()).minimum.y < 0:
|
||||
# Check if the model is positioned below the build plate and honor that when loading project files.
|
||||
if um_node.getMeshData() is not None:
|
||||
z_offset_value = um_node.getMeshData().getExtents(um_node.getWorldTransformation()).minimum.y
|
||||
um_node.addDecorator(ZOffsetDecorator())
|
||||
um_node.callDecoration("setZOffset",um_node.getMeshData().getExtents(um_node.getWorldTransformation()).minimum.y)
|
||||
um_node.callDecoration("setZOffset", z_offset_value)
|
||||
|
||||
result.append(um_node)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue