Turn GlobalStack's extruders property into a dict

We do not load the extruders in a fixed order, thus we cannot assume
that addExtruder is called in the right order. This means that index 0
of the extruders is not necessarily the extruder with position 0. So
instead, use the extruder position as a dict key.

Contributes to CURA-3738
This commit is contained in:
Arjen Hiemstra 2017-05-17 10:58:28 +02:00
parent 9686df285d
commit a7bf205dbc
2 changed files with 7 additions and 7 deletions

View file

@ -64,7 +64,7 @@ class ExtruderStack(CuraContainerStack):
limit_to_extruder = super().getProperty(key, "limit_to_extruder")
if (limit_to_extruder is not None and limit_to_extruder != "-1") and self.getMetaDataEntry("position") != str(limit_to_extruder):
result = self.getNextStack().extruders[int(limit_to_extruder)].getProperty(key, property_name)
result = self.getNextStack().extruders[str(limit_to_extruder)].getProperty(key, property_name)
if result is not None:
return result