mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Minor cleanup of SettingOverrideDecorator
We never use the _instance variable except in deepcopy, so no need to store that. Contributes to CURA-3719
This commit is contained in:
parent
8fb21b39ad
commit
573d25982e
1 changed files with 5 additions and 5 deletions
|
@ -26,8 +26,7 @@ class SettingOverrideDecorator(SceneNodeDecorator):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._stack = ContainerStack(stack_id = id(self))
|
self._stack = ContainerStack(stack_id = id(self))
|
||||||
self._stack.setDirty(False) # This stack does not need to be saved.
|
self._stack.setDirty(False) # This stack does not need to be saved.
|
||||||
self._instance = InstanceContainer(container_id = "SettingOverrideInstanceContainer")
|
self._stack.addContainer(InstanceContainer(container_id = "SettingOverrideInstanceContainer"))
|
||||||
self._stack.addContainer(self._instance)
|
|
||||||
|
|
||||||
if ExtruderManager.getInstance().extruderCount > 1:
|
if ExtruderManager.getInstance().extruderCount > 1:
|
||||||
self._extruder_stack = ExtruderManager.getInstance().getExtruderStack(0).getId()
|
self._extruder_stack = ExtruderManager.getInstance().getExtruderStack(0).getId()
|
||||||
|
@ -46,13 +45,14 @@ class SettingOverrideDecorator(SceneNodeDecorator):
|
||||||
## Create a fresh decorator object
|
## Create a fresh decorator object
|
||||||
deep_copy = SettingOverrideDecorator()
|
deep_copy = SettingOverrideDecorator()
|
||||||
## Copy the instance
|
## Copy the instance
|
||||||
deep_copy._instance = copy.deepcopy(self._instance, memo)
|
instance_container = copy.deepcopy(self._stack.getContainer(0), memo)
|
||||||
|
|
||||||
|
## Set the copied instance as the first (and only) instance container of the stack.
|
||||||
|
deep_copy._stack.replaceContainer(0, instance_container)
|
||||||
|
|
||||||
# Properly set the right extruder on the copy
|
# Properly set the right extruder on the copy
|
||||||
deep_copy.setActiveExtruder(self._extruder_stack)
|
deep_copy.setActiveExtruder(self._extruder_stack)
|
||||||
|
|
||||||
## Set the copied instance as the first (and only) instance container of the stack.
|
|
||||||
deep_copy._stack.replaceContainer(0, deep_copy._instance)
|
|
||||||
return deep_copy
|
return deep_copy
|
||||||
|
|
||||||
## Gets the currently active extruder to print this object with.
|
## Gets the currently active extruder to print this object with.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue