mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Simplify for loop in _calculateInformation()
This commit is contained in:
parent
93190dde9b
commit
2135e30aad
1 changed files with 2 additions and 3 deletions
|
@ -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"})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue