From b2ac2e0fc79b609b22b6412f635673ecc53be4fc Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 20 Dec 2017 12:22:39 +0100 Subject: [PATCH] Trust the stack values more than the decorator CURA-4705 A SceneNode and its decorators can be deepcopied. However, the data in some decorators will only be updated when a per-object settings stack triggers a property changed event. That event cannot copied. So, it can happen that a deepcopied SceneNode has inconsistent data in some of its decorators than what's in the per-object settings stack. --- plugins/CuraEngineBackend/StartSliceJob.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index efa0e87b9e..f12b8e656f 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -19,6 +19,10 @@ from UM.Settings.SettingRelation import RelationType from cura.OneAtATimeIterator import OneAtATimeIterator from cura.Settings.ExtruderManager import ExtruderManager + +NON_PRINTING_MESH_SETTINGS = ["anti_overhang_mesh", "infill_mesh", "cutting_mesh"] + + class StartJobResult(IntEnum): Finished = 1 Error = 2 @@ -133,11 +137,13 @@ class StartSliceJob(Job): temp_list = [] has_printing_mesh = False for node in DepthFirstIterator(self._scene.getRoot()): - if type(node) is SceneNode and node.getMeshData() and node.getMeshData().getVertices() is not None: - _non_printing_mesh = getattr(node, "_non_printing_mesh", False) - if not getattr(node, "_outside_buildarea", False) or _non_printing_mesh: + if node.callDecoration("isSliceable") and type(node) is SceneNode and node.getMeshData() and node.getMeshData().getVertices() is not None: + per_object_stack = node.callDecoration("getStack") + is_non_printing_mesh = any(per_object_stack.getProperty(key, "value") for key in NON_PRINTING_MESH_SETTINGS) + + if not getattr(node, "_outside_buildarea", False) or not is_non_printing_mesh: temp_list.append(node) - if not _non_printing_mesh: + if not is_non_printing_mesh: has_printing_mesh = True Job.yieldThread()