mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-19 23:09:07 +08:00
CURA-4284 some code cleanup while debugging
This commit is contained in:
parent
b0916e4b67
commit
d802c0bd26
@ -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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user