Also pull limit_to_extruder settings into per-object setting stack

Only for settings that are limited by a setting on the stack.

Contributes to issue CURA-4186.
This commit is contained in:
Ghostkeeper 2017-08-18 16:57:13 +02:00
parent 3c36c3427c
commit b7493ae1a8
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -325,14 +325,19 @@ class StartSliceJob(Job):
for key in changed_setting_keys: for key in changed_setting_keys:
setting = message.addRepeatedMessage("settings") setting = message.addRepeatedMessage("settings")
setting.name = key setting.name = key
setting.value = str(stack.getProperty(key, "value")).encode("utf-8") 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.
limited_stack = ExtruderManager.getInstance().getActiveExtruderStacks()[extruder]
else:
limited_stack = stack #Just take from the per-object settings itself.
setting.value = str(limited_stack.getProperty(key, "value")).encode("utf-8")
Job.yieldThread() Job.yieldThread()
## Recursive function to put all settings that require eachother for value changes in a list ## Recursive function to put all settings that require eachother for value changes in a list
# \param relations_set \type{set} Set of keys (strings) of settings that are influenced # \param relations_set \type{set} Set of keys (strings) of settings that are influenced
# \param relations list of relation objects that need to be checked. # \param relations list of relation objects that need to be checked.
def _addRelations(self, relations_set, relations): def _addRelations(self, relations_set, relations):
for relation in filter(lambda r: r.role == "value", relations): for relation in filter(lambda r: r.role == "value" or r.role == "limit_to_extruder", relations):
if relation.type == RelationType.RequiresTarget: if relation.type == RelationType.RequiresTarget:
continue continue