mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Use DepthFirstIterator to get all descendant Nodes
CURA-6915
This commit is contained in:
parent
ead0594c56
commit
b1cc651a6a
1 changed files with 2 additions and 5 deletions
|
@ -13,6 +13,7 @@ from UM.MimeTypeDatabase import MimeTypeDatabase, MimeType
|
||||||
from UM.PluginRegistry import PluginRegistry # To get the g-code writer.
|
from UM.PluginRegistry import PluginRegistry # To get the g-code writer.
|
||||||
from PyQt5.QtCore import QBuffer
|
from PyQt5.QtCore import QBuffer
|
||||||
|
|
||||||
|
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||||
from UM.Scene.SceneNode import SceneNode
|
from UM.Scene.SceneNode import SceneNode
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
from cura.Snapshot import Snapshot
|
from cura.Snapshot import Snapshot
|
||||||
|
@ -175,11 +176,7 @@ class UFPWriter(MeshWriter):
|
||||||
Might be empty in case of nonPrintingMesh
|
Might be empty in case of nonPrintingMesh
|
||||||
"""
|
"""
|
||||||
|
|
||||||
nodes = [node]
|
|
||||||
if node.callDecoration("isGroup"):
|
|
||||||
nodes = nodes + node.getAllChildren() # all descendants
|
|
||||||
|
|
||||||
return [{"name": item.getName()}
|
return [{"name": item.getName()}
|
||||||
for item in nodes
|
for item in DepthFirstIterator(node)
|
||||||
if item.getMeshData() is not None and not item.callDecoration("isNonPrintingMesh")
|
if item.getMeshData() is not None and not item.callDecoration("isNonPrintingMesh")
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue