mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 12:49:10 +08:00
Revert "Fix duplicating SettingOverrideDecorator settings"
This reverts commit 977eb8c94d3364b98b27582700942884bfce8b3a. This has been fixed in a different way in c7a3d33411a51f4fe284bfc45f0bba178636cc27
This commit is contained in:
parent
3ebc90337c
commit
caf700750c
@ -228,7 +228,7 @@ class CuraContainerStack(ContainerStack):
|
|||||||
#
|
#
|
||||||
# \throws Exception.InvalidContainerError Raised when trying to replace a container with a container that has an incorrect type.
|
# \throws Exception.InvalidContainerError Raised when trying to replace a container with a container that has an incorrect type.
|
||||||
@override(ContainerStack)
|
@override(ContainerStack)
|
||||||
def replaceContainer(self, index: int, container: ContainerInterface, postpone_emit: bool = False, force_replace: bool = False) -> None:
|
def replaceContainer(self, index: int, container: ContainerInterface, postpone_emit: bool = False) -> None:
|
||||||
expected_type = _ContainerIndexes.IndexTypeMap[index]
|
expected_type = _ContainerIndexes.IndexTypeMap[index]
|
||||||
if expected_type == "definition":
|
if expected_type == "definition":
|
||||||
if not isinstance(container, DefinitionContainer):
|
if not isinstance(container, DefinitionContainer):
|
||||||
@ -237,7 +237,7 @@ class CuraContainerStack(ContainerStack):
|
|||||||
raise Exceptions.InvalidContainerError("Cannot replace container at index {index} with a container that is not of {type} type, but {actual_type} type.".format(index = index, type = expected_type, actual_type = container.getMetaDataEntry("type")))
|
raise Exceptions.InvalidContainerError("Cannot replace container at index {index} with a container that is not of {type} type, but {actual_type} type.".format(index = index, type = expected_type, actual_type = container.getMetaDataEntry("type")))
|
||||||
|
|
||||||
current_container = self._containers[index]
|
current_container = self._containers[index]
|
||||||
if current_container.getId() == container.getId() and not force_replace:
|
if current_container.getId() == container.getId():
|
||||||
return
|
return
|
||||||
|
|
||||||
super().replaceContainer(index, container, postpone_emit)
|
super().replaceContainer(index, container, postpone_emit)
|
||||||
|
@ -56,8 +56,7 @@ class SettingOverrideDecorator(SceneNodeDecorator):
|
|||||||
instance_container = copy.deepcopy(self._stack.getContainer(0), memo)
|
instance_container = copy.deepcopy(self._stack.getContainer(0), memo)
|
||||||
|
|
||||||
## Set the copied instance as the first (and only) instance container of the stack.
|
## Set the copied instance as the first (and only) instance container of the stack.
|
||||||
# Force replacing the container even though the id of the created deepcopy is the same
|
deep_copy._stack.replaceContainer(0, instance_container)
|
||||||
deep_copy._stack.replaceContainer(0, instance_container, force_replace = True)
|
|
||||||
|
|
||||||
# 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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user