mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 13:03:59 -06:00
Set the global variant and material to empty for multi-extrusion machines
For multi-extrusion machines, we do not want variant or material profiles in the stack, because these are extruder specific and may cause wrong values to be used for extruders that did not specify a value in the extruder. Contributes to CURA-2652
This commit is contained in:
parent
e1dafc8288
commit
78ac4ef999
1 changed files with 19 additions and 4 deletions
|
@ -225,11 +225,26 @@ class MachineManager(QObject):
|
|||
self._global_container_stack.nameChanged.connect(self._onMachineNameChanged)
|
||||
self._global_container_stack.containersChanged.connect(self._onInstanceContainersChanged)
|
||||
self._global_container_stack.propertyChanged.connect(self._onPropertyChanged)
|
||||
material = self._global_container_stack.findContainer({"type": "material"})
|
||||
material.nameChanged.connect(self._onMaterialNameChanged)
|
||||
|
||||
quality = self._global_container_stack.findContainer({"type": "quality"})
|
||||
quality.nameChanged.connect(self._onQualityNameChanged)
|
||||
if self._global_container_stack.getProperty("machine_extruder_count", "value") > 1:
|
||||
# For multi-extrusion machines, we do not want variant or material profiles in the stack,
|
||||
# because these are extruder specific and may cause wrong values to be used for extruders
|
||||
# that did not specify a value in the extruder.
|
||||
global_variant = self._global_container_stack.findContainer(type = "variant")
|
||||
if global_variant != self._empty_variant_container:
|
||||
self._global_container_stack.replaceContainer(self._global_container_stack.getContainerIndex(global_variant), self._empty_variant_container)
|
||||
|
||||
global_material = self._global_container_stack.findContainer(type = "material")
|
||||
if global_material != self._empty_material_container:
|
||||
self._global_container_stack.replaceContainer(self._global_container_stack.getContainerIndex(global_material), self._empty_material_container)
|
||||
|
||||
else:
|
||||
material = self._global_container_stack.findContainer({"type": "material"})
|
||||
material.nameChanged.connect(self._onMaterialNameChanged)
|
||||
|
||||
quality = self._global_container_stack.findContainer({"type": "quality"})
|
||||
quality.nameChanged.connect(self._onQualityNameChanged)
|
||||
|
||||
|
||||
def _onActiveExtruderStackChanged(self):
|
||||
self.blurSettings.emit() # Ensure no-one has focus.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue