diff options
author | Jaime van Kessel <nallath@gmail.com> | 2017-05-18 17:42:11 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2017-05-18 17:42:11 +0300 |
commit | f2f83750c2e277c32bf0a7099d8329dcb84f5207 (patch) | |
tree | 28532ed3caa374ea5641ec5d0470382a49ee38be /plugins/GCodeWriter | |
parent | 7e4f983cd61eb2f8d1c2a808b33f1fb7ab3a12c5 (diff) |
Type is now always added when deserializing profiles to g-code
CURA-3829
Diffstat (limited to 'plugins/GCodeWriter')
-rw-r--r-- | plugins/GCodeWriter/GCodeWriter.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/GCodeWriter/GCodeWriter.py b/plugins/GCodeWriter/GCodeWriter.py index ad730fbe2a..47ccc21bcd 100644 --- a/plugins/GCodeWriter/GCodeWriter.py +++ b/plugins/GCodeWriter/GCodeWriter.py @@ -85,6 +85,7 @@ class GCodeWriter(MeshWriter): for key in instance_container1.getAllKeys(): flat_container.setProperty(key, "value", instance_container1.getProperty(key, "value")) + return flat_container @@ -106,6 +107,9 @@ class GCodeWriter(MeshWriter): return "" flat_global_container = self._createFlattenedContainerInstance(stack.getTop(), container_with_profile) + # If the quality changes is not set, we need to set type manually + if flat_global_container.getMetaDataEntry("type", None) is None: + flat_global_container.addMetaDataEntry("type", "quality_changes") # Ensure that quality_type is set. (Can happen if we have empty quality changes). if flat_global_container.getMetaDataEntry("quality_type", None) is None: @@ -120,6 +124,9 @@ class GCodeWriter(MeshWriter): Logger.log("w", "No extruder quality profile found, not writing quality for extruder %s to file!", extruder.getId()) continue flat_extruder_quality = self._createFlattenedContainerInstance(extruder.getTop(), extruder_quality) + # If the quality changes is not set, we need to set type manually + if flat_extruder_quality.getMetaDataEntry("type", None) is None: + flat_extruder_quality.addMetaDataEntry("type", "quality_changes") # Ensure that extruder is set. (Can happen if we have empty quality changes). if flat_extruder_quality.getMetaDataEntry("extruder", None) is None: |