From 22c1a118a869adb2f7c0939e7cce54820cde5f3d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 20 Jul 2017 10:28:07 +0200 Subject: [PATCH] Fix conflict detection when there is no definition_changes CURA-4053 An old project file doesn't have the definition_changes container in the stacks. When this is the case, Cura should also check if the definition changes container in an existing stack is empty or not for project file loading conflict detection. --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index eb45b9ef3d..aca3948813 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -256,6 +256,9 @@ class ThreeMFWorkspaceReader(WorkspaceReader): container_id = self._old_empty_profile_id_dict.get(container_id, container_id) # HACK: there used to be 5, now we have one more 5 - definition changes if len(id_list) == 6 and index == 5: + if global_stack.getContainer(5).getId() != "empty": + machine_conflict = True + break index = 6 if global_stack.getContainer(index).getId() != container_id: machine_conflict = True @@ -294,6 +297,9 @@ class ThreeMFWorkspaceReader(WorkspaceReader): container_id = self._old_empty_profile_id_dict.get(container_id, container_id) # HACK: there used to be 5, now we have one more 5 - definition changes if len(id_list) == 6 and index == 5: + if existing_extruder_stack.getContainer(5).getId() != "empty": + machine_conflict = True + break index = 6 if existing_extruder_stack.getContainer(index).getId() != container_id: machine_conflict = True