diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 279e7e0c03..50d80e11bb 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -212,14 +212,13 @@ class PrintInformation(QObject): material_preference_values = json.loads(Preferences.getInstance().getValue("cura/material_settings")) extruder_stacks = global_stack.extruders - for extruder_key in global_stack.extruders.keys(): - index = int(extruder_key) + for position, extruder_stack in extruder_stacks.keys(): + index = int(position) if index >= len(self._material_amounts): # Right now the _material_amounts is a list, where the index is the extruder number continue amount = self._material_amounts[index] ## Find the right extruder stack. As the list isn't sorted because it's a annoying generator, we do some # list comprehension filtering to solve this for us. - extruder_stack = extruder_stacks[str(index)] density = extruder_stack.getMetaDataEntry("properties", {}).get("density", 0) material = extruder_stack.findContainer({"type": "material"})