mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-04 03:31:02 +08:00
Merge pull request #16976 from Ultimaker/CURA_9755-Meshes-in-correct-location
Cura 9755 meshes in correct location
This commit is contained in:
commit
673303a238
@ -186,6 +186,13 @@ class ThreeMFReader(MeshReader):
|
|||||||
if len(um_node.getAllChildren()) == 1:
|
if len(um_node.getAllChildren()) == 1:
|
||||||
# We don't want groups of one, so move the node up one "level"
|
# We don't want groups of one, so move the node up one "level"
|
||||||
child_node = um_node.getChildren()[0]
|
child_node = um_node.getChildren()[0]
|
||||||
|
# Move all the meshes of children so that toolhandles are shown in the correct place.
|
||||||
|
if child_node.getMeshData():
|
||||||
|
extents = child_node.getMeshData().getExtents()
|
||||||
|
move_matrix = Matrix()
|
||||||
|
move_matrix.translate(-extents.center)
|
||||||
|
child_node.setMeshData(child_node.getMeshData().getTransformed(move_matrix))
|
||||||
|
child_node.translate(extents.center)
|
||||||
parent_transformation = um_node.getLocalTransformation()
|
parent_transformation = um_node.getLocalTransformation()
|
||||||
child_transformation = child_node.getLocalTransformation()
|
child_transformation = child_node.getLocalTransformation()
|
||||||
child_node.setTransformation(parent_transformation.multiply(child_transformation))
|
child_node.setTransformation(parent_transformation.multiply(child_transformation))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user