mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 07:23:13 +08:00
Ensure that the 3mf reader doesn't make groups of one
This commit is contained in:
parent
141ad8ff1d
commit
91690524c0
@ -169,8 +169,16 @@ class ThreeMFReader(MeshReader):
|
||||
setting_container.setProperty(key, "value", setting_value)
|
||||
|
||||
if len(um_node.getChildren()) > 0 and um_node.getMeshData() is None:
|
||||
group_decorator = GroupDecorator()
|
||||
um_node.addDecorator(group_decorator)
|
||||
if len(um_node.getAllChildren()) == 1:
|
||||
# We don't want groups of one, so move the node up one "level"
|
||||
child_node = um_node.getChildren()[0]
|
||||
parent_transformation = um_node.getLocalTransformation()
|
||||
child_transformation = child_node.getLocalTransformation()
|
||||
child_node.setTransformation(parent_transformation.multiply(child_transformation))
|
||||
um_node = um_node.getChildren()[0]
|
||||
else:
|
||||
group_decorator = GroupDecorator()
|
||||
um_node.addDecorator(group_decorator)
|
||||
um_node.setSelectable(True)
|
||||
if um_node.getMeshData():
|
||||
# Assuming that all nodes with mesh data are printable objects
|
||||
@ -192,8 +200,8 @@ class ThreeMFReader(MeshReader):
|
||||
um_node = self._convertSavitarNodeToUMNode(node, file_name)
|
||||
if um_node is None:
|
||||
continue
|
||||
# compensate for original center position, if object(s) is/are not around its zero position
|
||||
|
||||
# compensate for original center position, if object(s) is/are not around its zero position
|
||||
transform_matrix = Matrix()
|
||||
mesh_data = um_node.getMeshData()
|
||||
if mesh_data is not None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user