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.
This commit is contained in:
Ghostkeeper 2016-10-14 11:46:39 +02:00
parent a8ebdc8e39
commit 4769b22138
No known key found for this signature in database
GPG key ID: 701948C5954A7385

View file

@ -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())