mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Ensure that the 3mf reader doesn't make groups of one
This commit is contained in:
parent
141ad8ff1d
commit
91690524c0
1 changed files with 11 additions and 3 deletions
|
@ -169,6 +169,14 @@ class ThreeMFReader(MeshReader):
|
||||||
setting_container.setProperty(key, "value", setting_value)
|
setting_container.setProperty(key, "value", setting_value)
|
||||||
|
|
||||||
if len(um_node.getChildren()) > 0 and um_node.getMeshData() is None:
|
if len(um_node.getChildren()) > 0 and um_node.getMeshData() is None:
|
||||||
|
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()
|
group_decorator = GroupDecorator()
|
||||||
um_node.addDecorator(group_decorator)
|
um_node.addDecorator(group_decorator)
|
||||||
um_node.setSelectable(True)
|
um_node.setSelectable(True)
|
||||||
|
@ -192,8 +200,8 @@ class ThreeMFReader(MeshReader):
|
||||||
um_node = self._convertSavitarNodeToUMNode(node, file_name)
|
um_node = self._convertSavitarNodeToUMNode(node, file_name)
|
||||||
if um_node is None:
|
if um_node is None:
|
||||||
continue
|
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()
|
transform_matrix = Matrix()
|
||||||
mesh_data = um_node.getMeshData()
|
mesh_data = um_node.getMeshData()
|
||||||
if mesh_data is not None:
|
if mesh_data is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue