When switching active extruder, get the extruder train from definition id

Not from extruder container stack ID.

Contributes to issues CURA-340 and CURA-1278.
This commit is contained in:
Ghostkeeper 2016-06-08 16:26:57 +02:00
parent 7dbafa06d1
commit 4d418a7c1a
No known key found for this signature in database
GPG key ID: 701948C5954A7385

View file

@ -36,7 +36,7 @@ class ExtruderManager(QObject):
if not UM.Application.getInstance().getGlobalContainerStack():
return None #No active machine, so no active extruder.
try:
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)]
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getBottom().getId()][str(self._active_extruder_index)]
except KeyError: #Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong.
return None