Send all global_inherits_stack to engine

Only the settings for which global_inherits_stack is set should be sent to the engine.

Contributes to issue CURA-2011.
This commit is contained in:
Ghostkeeper 2016-07-29 16:22:18 +02:00
parent fb96950762
commit b21a1f311a
No known key found for this signature in database
GPG key ID: 701948C5954A7385
2 changed files with 24 additions and 1 deletions

View file

@ -134,6 +134,7 @@ class StartSliceJob(Job):
return
self._buildGlobalSettingsMessage(stack)
self._buildGlobalInheritsStackMessage(stack)
for extruder_stack in cura.Settings.ExtruderManager.getInstance().getMachineExtruders(stack.getId()):
self._buildExtruderMessage(extruder_stack)
@ -216,6 +217,21 @@ class StartSliceJob(Job):
else:
setting_message.value = str(value).encode("utf-8")
## Sends for some settings which extruder they should fallback to if not
# set.
#
# This is only set for settings that have the global_inherits_stack
# property.
#
# \param stack The global stack with all settings, from which to read the
# global_inherits_stack property.
def _buildGlobalInheritsStackMessage(self, stack):
for key in stack.getAllKeys():
if stack.hasProperty(key, "global_inherits_stack"):
setting_extruder = self._slice_message.addRepeatedMessage("global_inherits_stack")
setting_extruder.name = key
setting_extruder.extruder = int(stack.getProperty(key, "global_inherits_stack"))
## Check if a node has per object settings and ensure that they are set correctly in the message
# \param node \type{SceneNode} Node to check.
# \param message object_lists message to put the per object settings in