diff options
author | Diego Prado Gesto <d.pradogesto@ultimaker.com> | 2018-02-16 16:01:46 +0300 |
---|---|---|
committer | Diego Prado Gesto <d.pradogesto@ultimaker.com> | 2018-02-16 16:01:46 +0300 |
commit | 744313af273ed34a5796d3970c3915f68abaedc7 (patch) | |
tree | 5e65fddce7ed94de893394c2647fdf252df2c583 /plugins/GCodeWriter | |
parent | 85059882fedd73525ccae1a59287b3614bf7609a (diff) |
CURA-4946 Add the quality_definition metadata entry to the gcode so when
parsing, the quality definition is taken into account instead of the
definition.
The message when importing a profile to a different machine,
now shows the expected machine and the current machine definition id.!!
Diffstat (limited to 'plugins/GCodeWriter')
-rw-r--r-- | plugins/GCodeWriter/GCodeWriter.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/GCodeWriter/GCodeWriter.py b/plugins/GCodeWriter/GCodeWriter.py index d06332bec1..368942fd08 100644 --- a/plugins/GCodeWriter/GCodeWriter.py +++ b/plugins/GCodeWriter/GCodeWriter.py @@ -5,6 +5,7 @@ from UM.Mesh.MeshWriter import MeshWriter from UM.Logger import Logger from UM.Application import Application from UM.Settings.InstanceContainer import InstanceContainer +from UM.Util import parseBool from cura.Settings.ExtruderManager import ExtruderManager @@ -120,6 +121,10 @@ class GCodeWriter(MeshWriter): if flat_global_container.getMetaDataEntry("quality_type", None) is None: flat_global_container.addMetaDataEntry("quality_type", stack.quality.getMetaDataEntry("quality_type", "normal")) + # Ensure that quality_definition is set. (Can happen if we have empty quality changes). + if parseBool(stack.getMetaDataEntry("has_machine_quality", "False")): + flat_global_container.addMetaDataEntry("quality_definition", stack.getMetaDataEntry("quality_definition")) + serialized = flat_global_container.serialize() data = {"global_quality": serialized} |