From eaa27114c63101a86d0546d1ff0b1ec336db9164 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 21 Dec 2017 12:43:50 +0100 Subject: [PATCH] Fix ID changing in project loading --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index a7dad68519..40d64590f5 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -682,12 +682,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader): file_name = global_stack_file) # Ensure a unique ID and name - stack._id = global_stack_id_new - - # 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", global_stack_id_new) + stack.setMetaDataEntry("id", global_stack_id_new) # Only machines need a new name, stacks may be non-unique stack.setName(global_stack_name_new) @@ -741,7 +736,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader): stack.deserialize(extruder_file_content, file_name = extruder_stack_file) # Ensure a unique ID and name - stack._id = new_id + stack.setMetaDataEntry("id", new_id) self._container_registry.addContainer(stack) extruder_stacks_added.append(stack)