Merge branch 'master' into cura-1707

This commit is contained in:
Jack Ha 2016-07-18 16:06:08 +02:00
commit 2936ad508c
7 changed files with 122 additions and 19 deletions

View file

@ -174,18 +174,19 @@ class StartSliceJob(Job):
def _buildExtruderMessage(self, stack):
message = self._slice_message.addRepeatedMessage("extruders")
message.id = int(stack.getMetaDataEntry("position"))
material_instance_container = stack.findContainer({"type": "material"})
for key in stack.getAllKeys():
setting = message.getMessage("settings").addRepeatedMessage("settings")
setting.name = key
setting.value = str(stack.getProperty(key, "value")).encode("utf-8")
if key == "material_guid" and material_instance_container:
# Also send the material GUID. This is a setting in fdmprinter, but we have no interface for it.
setting.value = str(material_instance_container.getMetaDataEntry("GUID", "")).encode("utf-8")
else:
setting.value = str(stack.getProperty(key, "value")).encode("utf-8")
Job.yieldThread()
# ALso send the material GUID as a setting.
material_instance_container = stack.findContainer({"type": "material"})
if material_instance_container:
setting = message.getMessage("settings").addRepeatedMessage("settings")
setting.name = "material_GUID"
setting.value = str(material_instance_container.getMetaDataEntry("GUID", "")).encode("utf-8")
## Sends all global settings to the engine.
#
# The settings are taken from the global stack. This does not include any