From b1cc651a6a3eecdfdfc2bb714fabbab2a714cc0f Mon Sep 17 00:00:00 2001 From: Nino van Hooff Date: Fri, 3 Jul 2020 14:46:59 +0200 Subject: [PATCH] Use DepthFirstIterator to get all descendant Nodes CURA-6915 --- plugins/UFPWriter/UFPWriter.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/UFPWriter/UFPWriter.py b/plugins/UFPWriter/UFPWriter.py index 2d37378155..4473a602ae 100644 --- a/plugins/UFPWriter/UFPWriter.py +++ b/plugins/UFPWriter/UFPWriter.py @@ -13,6 +13,7 @@ from UM.MimeTypeDatabase import MimeTypeDatabase, MimeType from UM.PluginRegistry import PluginRegistry # To get the g-code writer. from PyQt5.QtCore import QBuffer +from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Scene.SceneNode import SceneNode from cura.CuraApplication import CuraApplication from cura.Snapshot import Snapshot @@ -175,11 +176,7 @@ class UFPWriter(MeshWriter): Might be empty in case of nonPrintingMesh """ - nodes = [node] - if node.callDecoration("isGroup"): - nodes = nodes + node.getAllChildren() # all descendants - return [{"name": item.getName()} - for item in nodes + for item in DepthFirstIterator(node) if item.getMeshData() is not None and not item.callDecoration("isNonPrintingMesh") ]