mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-04 17:35:12 +08:00
Updated deepcopy to correctly copy the instance container
CURA-1636
This commit is contained in:
parent
57ce8edcd3
commit
5761307b33
@ -29,10 +29,10 @@ class SettingOverrideDecorator(SceneNodeDecorator):
|
|||||||
def __deepcopy__(self, memo):
|
def __deepcopy__(self, memo):
|
||||||
## Create a fresh decorator object
|
## Create a fresh decorator object
|
||||||
deep_copy = SettingOverrideDecorator()
|
deep_copy = SettingOverrideDecorator()
|
||||||
## Copy the stack
|
## Copy the instance
|
||||||
deep_copy._stack = copy.deepcopy(self._stack, memo)
|
deep_copy._instance = copy.deepcopy(self._instance, memo)
|
||||||
## Ensure that the id is unique.
|
## Set the copied instance as the first (and only) instance container of the stack.
|
||||||
deep_copy._stack._id = id(deep_copy)
|
deep_copy._stack.replaceContainer(0, deep_copy._instance)
|
||||||
return deep_copy
|
return deep_copy
|
||||||
|
|
||||||
def _onSettingChanged(self, instance, property):
|
def _onSettingChanged(self, instance, property):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user