From 3245c2fe32d93ab77735210ac91e5c9c0c38098d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 14 Nov 2016 17:08:43 +0100 Subject: [PATCH] Extruder stacks are no longer renamed when loading from workspace CURA-1263 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 94394ba4e1..08da848392 100644 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -213,13 +213,17 @@ 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 - stack.setName(self._container_registry.uniqueName(stack.getName())) + + 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: Logger.log("w", "Resolve strategy of %s for machine is not supported", self._resolve_strategies["machine"])