mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Copy values of global-only setting values to all extruders
CURA-1758
This commit is contained in:
parent
2387da1a28
commit
97b3dd8f70
2 changed files with 17 additions and 3 deletions
|
@ -112,8 +112,11 @@ class ExtruderManager(QObject):
|
||||||
for extruder_train in extruder_trains:
|
for extruder_train in extruder_trains:
|
||||||
self._extruder_trains[machine_id][extruder_train.getMetaDataEntry("position")] = extruder_train
|
self._extruder_trains[machine_id][extruder_train.getMetaDataEntry("position")] = extruder_train
|
||||||
|
|
||||||
# Ensure that the extruder train stacks are linked to global stack.
|
# Make sure the next stack is a stack that contains only the machine definition
|
||||||
extruder_train.setNextStack(UM.Application.getInstance().getGlobalContainerStack())
|
if not extruder_train.getNextStack():
|
||||||
|
shallowStack = UM.Settings.ContainerStack(machine_id + "_shallow")
|
||||||
|
shallowStack.addContainer(machine_definition)
|
||||||
|
extruder_train.setNextStack(shallowStack)
|
||||||
changed = True
|
changed = True
|
||||||
if changed:
|
if changed:
|
||||||
self.extrudersChanged.emit(machine_id)
|
self.extrudersChanged.emit(machine_id)
|
||||||
|
@ -226,7 +229,11 @@ class ExtruderManager(QObject):
|
||||||
container_registry.addContainer(user_profile)
|
container_registry.addContainer(user_profile)
|
||||||
container_stack.addContainer(user_profile)
|
container_stack.addContainer(user_profile)
|
||||||
|
|
||||||
container_stack.setNextStack(UM.Application.getInstance().getGlobalContainerStack())
|
# Make sure the next stack is a stack that contains only the machine definition
|
||||||
|
if not container_stack.getNextStack():
|
||||||
|
shallowStack = UM.Settings.ContainerStack(machine_id + "_shallow")
|
||||||
|
shallowStack.addContainer(machine_definition)
|
||||||
|
container_stack.setNextStack(shallowStack)
|
||||||
|
|
||||||
container_registry.addContainer(container_stack)
|
container_registry.addContainer(container_stack)
|
||||||
|
|
||||||
|
|
|
@ -204,6 +204,13 @@ class MachineManager(QObject):
|
||||||
if self._active_container_stack.getProperty("extruder_nr", "value") == int(self._active_container_stack.getProperty(key, "global_inherits_stack")):
|
if self._active_container_stack.getProperty("extruder_nr", "value") == int(self._active_container_stack.getProperty(key, "global_inherits_stack")):
|
||||||
self._global_container_stack.getTop().setProperty(key, "value", self._active_container_stack.getProperty(key, "value"))
|
self._global_container_stack.getTop().setProperty(key, "value", self._active_container_stack.getProperty(key, "value"))
|
||||||
|
|
||||||
|
# Global-only setting values should be set on all extruders at once
|
||||||
|
if not self._global_container_stack.getProperty(key, "settable_per_extruder"):
|
||||||
|
extruder_stacks = ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId())
|
||||||
|
for extruder_stack in extruder_stacks:
|
||||||
|
if extruder_stacks != self._active_container_stack:
|
||||||
|
extruder_stack.getTop().setProperty(key, "value", self._active_container_stack.getProperty(key, "value"))
|
||||||
|
|
||||||
if property_name == "validationState":
|
if property_name == "validationState":
|
||||||
if self._global_stack_valid:
|
if self._global_stack_valid:
|
||||||
changed_validation_state = self._active_container_stack.getProperty(key, property_name)
|
changed_validation_state = self._active_container_stack.getProperty(key, property_name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue