mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Rework based on review
CURA-1689
This commit is contained in:
parent
1bab4032fd
commit
f0340c6d63
1 changed files with 8 additions and 6 deletions
|
|
@ -67,12 +67,14 @@ class ExtruderManager(QObject):
|
|||
self.activeExtruderChanged.emit()
|
||||
|
||||
def getActiveExtruderStack(self):
|
||||
try:
|
||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack:
|
||||
global_definition_container = UM.Application.getInstance().getGlobalContainerStack().getBottom()
|
||||
if global_definition_container:
|
||||
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)]
|
||||
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getBottom().getId()][str(self._active_extruder_index)]
|
||||
except AttributeError:
|
||||
return None
|
||||
except KeyError:
|
||||
return None
|
||||
|
||||
|
||||
## Adds all extruders of a specific machine definition to the extruder
|
||||
# manager.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue