mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 08:36:04 +08:00
Extruder stacks are no longer renamed when loading from workspace
CURA-1263
This commit is contained in:
parent
2e4b430cf8
commit
3245c2fe32
@ -213,12 +213,16 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
stack = ContainerStack(new_id)
|
||||
stack.deserialize(archive.open(container_stack_file).read().decode("utf-8"))
|
||||
|
||||
# Ensure a unique ID and name
|
||||
stack._id = new_id
|
||||
|
||||
# Extruder stacks are "bound" to a machine. If we add the machine as a new one, the id of the
|
||||
# bound machine also needs to change.
|
||||
if stack.getMetaDataEntry("machine", None):
|
||||
stack.setMetaDataEntry("machine", self.getNewId(stack.getMetaDataEntry("machine")))
|
||||
# Ensure a unique ID and name
|
||||
stack._id = new_id
|
||||
|
||||
if stack.getMetaDataEntry("type") != "extruder_train":
|
||||
# Only machines need a new name, stacks may be non-unique
|
||||
stack.setName(self._container_registry.uniqueName(stack.getName()))
|
||||
self._container_registry.addContainer(stack)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user