Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2017-07-06 14:50:53 +0300
committerGhostkeeper <rubend@tutanota.com>2017-07-06 14:52:54 +0300
commitbd75102ee530e93d7c852efdcc1aa3611a4921cf (patch)
tree3c19d0999b199cbbfb5e61ca17a8ed0f9081c11a /plugins/GCodeWriter
parenteb88ad5a3d29b602cbc5ad01c2230f6df0111c80 (diff)
Fix saving g-code if no quality profile is set
If the quality profile was 'empty', then the container type wasn't properly set, so you can't find any quality profile. This gets the quality profile from the stacks, so you will find the empty profile (which has the wrong type but at least you can try to request metadata from it).
Diffstat (limited to 'plugins/GCodeWriter')
-rw-r--r--plugins/GCodeWriter/GCodeWriter.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/GCodeWriter/GCodeWriter.py b/plugins/GCodeWriter/GCodeWriter.py
index 47ccc21bcd..61bd682de0 100644
--- a/plugins/GCodeWriter/GCodeWriter.py
+++ b/plugins/GCodeWriter/GCodeWriter.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 Ultimaker B.V.
+# Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Mesh.MeshWriter import MeshWriter
@@ -113,7 +113,7 @@ class GCodeWriter(MeshWriter):
# Ensure that quality_type is set. (Can happen if we have empty quality changes).
if flat_global_container.getMetaDataEntry("quality_type", None) is None:
- flat_global_container.addMetaDataEntry("quality_type", stack.findContainer({"type": "quality"}).getMetaDataEntry("quality_type", "normal"))
+ flat_global_container.addMetaDataEntry("quality_type", stack.quality.getMetaDataEntry("quality_type", "normal"))
serialized = flat_global_container.serialize()
data = {"global_quality": serialized}
@@ -134,7 +134,7 @@ class GCodeWriter(MeshWriter):
# Ensure that quality_type is set. (Can happen if we have empty quality changes).
if flat_extruder_quality.getMetaDataEntry("quality_type", None) is None:
- flat_extruder_quality.addMetaDataEntry("quality_type", extruder.findContainer({"type": "quality"}).getMetaDataEntry("quality_type", "normal"))
+ flat_extruder_quality.addMetaDataEntry("quality_type", extruder.quality.getMetaDataEntry("quality_type", "normal"))
extruder_serialized = flat_extruder_quality.serialize()
data.setdefault("extruder_quality", []).append(extruder_serialized)