This commit is contained in:
fieldOfView 2016-06-15 11:13:48 +02:00
commit 89f64eb870

View File

@ -67,12 +67,14 @@ class ExtruderManager(QObject):
self.activeExtruderChanged.emit() self.activeExtruderChanged.emit()
def getActiveExtruderStack(self): def getActiveExtruderStack(self):
try: global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getBottom().getId()][str(self._active_extruder_index)] if global_container_stack:
except AttributeError: global_definition_container = UM.Application.getInstance().getGlobalContainerStack().getBottom()
return None if global_definition_container:
except KeyError: if global_definition_container.getId() in self._extruder_trains:
return None if str(self._active_extruder_index) in self._extruder_trains[global_definition_container.getId()]:
return self._extruder_trains[global_definition_container.getId()][str(self._active_extruder_index)]
## Adds all extruders of a specific machine definition to the extruder ## Adds all extruders of a specific machine definition to the extruder
# manager. # manager.