mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
material_guid is now also a setting in fdmprinter
CURA-1836
This commit is contained in:
parent
a17cf59699
commit
48d39ce387
2 changed files with 16 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue