mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 22:46:09 +08:00
Rework based on review
CURA-1689
This commit is contained in:
parent
1bab4032fd
commit
f0340c6d63
@ -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 str(self._active_extruder_index) in self._extruder_trains[global_definition_container.getId()]:
|
||||||
return None
|
return self._extruder_trains[global_definition_container.getId()][str(self._active_extruder_index)]
|
||||||
|
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getBottom().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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user