mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -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):
|
def _buildExtruderMessage(self, stack):
|
||||||
message = self._slice_message.addRepeatedMessage("extruders")
|
message = self._slice_message.addRepeatedMessage("extruders")
|
||||||
message.id = int(stack.getMetaDataEntry("position"))
|
message.id = int(stack.getMetaDataEntry("position"))
|
||||||
|
|
||||||
|
material_instance_container = stack.findContainer({"type": "material"})
|
||||||
|
|
||||||
for key in stack.getAllKeys():
|
for key in stack.getAllKeys():
|
||||||
setting = message.getMessage("settings").addRepeatedMessage("settings")
|
setting = message.getMessage("settings").addRepeatedMessage("settings")
|
||||||
setting.name = key
|
setting.name = key
|
||||||
|
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")
|
setting.value = str(stack.getProperty(key, "value")).encode("utf-8")
|
||||||
Job.yieldThread()
|
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.
|
## Sends all global settings to the engine.
|
||||||
#
|
#
|
||||||
# The settings are taken from the global stack. This does not include any
|
# The settings are taken from the global stack. This does not include any
|
||||||
|
|
|
@ -57,6 +57,14 @@
|
||||||
"settable_per_extruder": false,
|
"settable_per_extruder": false,
|
||||||
"settable_per_meshgroup": false
|
"settable_per_meshgroup": false
|
||||||
},
|
},
|
||||||
|
"material_guid":
|
||||||
|
{
|
||||||
|
"label": "Material GUID",
|
||||||
|
"description": "GUID of the material. This is set automatically. ",
|
||||||
|
"default_value": "",
|
||||||
|
"type": "str",
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
"material_bed_temp_wait":
|
"material_bed_temp_wait":
|
||||||
{
|
{
|
||||||
"label": "Wait for bed heatup",
|
"label": "Wait for bed heatup",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue