mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Adapting the code in case a multiextruder printer will use only one extruder - CURA-4359
This commit is contained in:
parent
28aadc1b05
commit
568535e3e2
4 changed files with 40 additions and 18 deletions
|
@ -92,13 +92,22 @@ class ProfilesModel(InstanceContainersModel):
|
|||
if global_container_stack is None:
|
||||
return
|
||||
|
||||
# Detecting if the machine has multiple extrusion
|
||||
multiple_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
|
||||
# Get the list of extruders and place the selected extruder at the front of the list.
|
||||
extruder_manager = ExtruderManager.getInstance()
|
||||
active_extruder = extruder_manager.getActiveExtruderStack()
|
||||
extruder_stacks = extruder_manager.getActiveExtruderStacks()
|
||||
if active_extruder in extruder_stacks:
|
||||
extruder_stacks.remove(active_extruder)
|
||||
extruder_stacks = [active_extruder] + extruder_stacks
|
||||
if extruder_stacks:
|
||||
if multiple_extrusion:
|
||||
# Place the active extruder at the front of the list.
|
||||
if active_extruder in extruder_stacks:
|
||||
extruder_stacks.remove(active_extruder)
|
||||
extruder_stacks = [active_extruder] + extruder_stacks
|
||||
else:
|
||||
# The active extruder is the first in the list and only the active extruder is use to compute the usable qualities
|
||||
active_extruder = None
|
||||
extruder_stacks = []
|
||||
|
||||
# Get a list of usable/available qualities for this machine and material
|
||||
qualities = QualityManager.getInstance().findAllUsableQualitiesForMachineAndExtruders(global_container_stack,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue