Browse Source

Sort profiles on extruder position before exporting

In the importer the extruders are sorted on extruder position. In the exporter they need to be in the same order.

Contributes to issue CURA-2655.
Ghostkeeper 8 years ago
parent
commit
4769b22138
1 changed files with 1 additions and 1 deletions
  1. 1 1
      plugins/GCodeWriter/GCodeWriter.py

+ 1 - 1
plugins/GCodeWriter/GCodeWriter.py

@@ -106,7 +106,7 @@ class GCodeWriter(MeshWriter):
         serialized = flat_global_container.serialize()
         data = {"global_quality": serialized}
 
-        for extruder in ExtruderManager.getInstance().getMachineExtruders(stack.getId()):
+        for extruder in sorted(ExtruderManager.getInstance().getMachineExtruders(stack.getId()), key = lambda k: k.getMetaDataEntry("position")):
             extruder_quality = extruder.findContainer({"type": "quality_changes"})
             if not extruder_quality:
                 Logger.log("w", "No extruder quality profile found, not writing quality for extruder %s to file!", extruder.getId())