From d802c0bd26c10481a72811db6ccf8892d47785f4 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 11 Sep 2017 09:14:50 +0200 Subject: [PATCH] CURA-4284 some code cleanup while debugging --- plugins/CuraEngineBackend/StartSliceJob.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 13aee06289..0f21c0d781 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -319,11 +319,13 @@ class StartSliceJob(Job): # \param message object_lists message to put the per object settings in def _handlePerObjectSettings(self, node, message): stack = node.callDecoration("getStack") - if not stack: # Check if the node has a stack attached to it and the stack has any settings in the top container. + + # Check if the node has a stack attached to it and the stack has any settings in the top container. + if not stack: return # Check all settings for relations, so we can also calculate the correct values for dependent settings. - top_of_stack = stack.getTop() #Cache for efficiency. + top_of_stack = stack.getTop() # Cache for efficiency. changed_setting_keys = set(top_of_stack.getAllKeys()) for key in top_of_stack.getAllKeys(): instance = top_of_stack.getInstance(key) @@ -339,10 +341,13 @@ class StartSliceJob(Job): setting = message.addRepeatedMessage("settings") setting.name = key extruder = int(round(float(stack.getProperty(key, "limit_to_extruder")))) - if extruder >= 0 and key not in top_of_stack.getAllKeys(): #Limited to a specific extruder, but not overridden by per-object settings. + + # Check if limited to a specific extruder, but not overridden by per-object settings. + if extruder >= 0 and key not in top_of_stack.getAllKeys(): limited_stack = ExtruderManager.getInstance().getActiveExtruderStacks()[extruder] else: - limited_stack = stack #Just take from the per-object settings itself. + limited_stack = stack + setting.value = str(limited_stack.getProperty(key, "value")).encode("utf-8") Job.yieldThread()