From 141cfe776e60057959a53b7424ad8aceeae782e3 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 21 Jul 2017 11:28:44 +0200 Subject: [PATCH] Fix handling old stack without definition_changes and add doc CURA-4053 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 56b8c62d28..1a7a06d8b6 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -863,9 +863,11 @@ class ThreeMFWorkspaceReader(WorkspaceReader): container_list = container_string.split(",") container_ids = [container_id for container_id in container_list if container_id != ""] - if len(container_ids) == 5: + # HACK: there used to be 6 containers numbering from 0 to 5 in a stack, + # now we have 7: index 5 becomes "definition_changes" + if len(container_ids) == 6: # Hack; We used to not save the definition changes. Fix this. - container_ids.insert(4, "empty") + container_ids.insert(5, "empty") return container_ids