From 79561f44b13f821bc00b00ca6c642cf0b8bd2dd1 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Wed, 10 May 2017 16:16:57 +0200 Subject: [PATCH] Fix project load, new non existing machine. CURA-3756 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 4aa1f17ba1..e751211d04 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -262,6 +262,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader): return WorkspaceReader.PreReadResult.cancelled self._resolve_strategies = self._dialog.getResult() + # Default values + for k, v in self._resolve_strategies.items(): + if v is None: + self._resolve_strategies[k] = "new" return WorkspaceReader.PreReadResult.accepted @@ -582,7 +586,11 @@ class ThreeMFWorkspaceReader(WorkspaceReader): self._container_registry.addContainer(container) # Replace the quality/definition changes container - old_container = global_stack.findContainer({"type": container_type}) + if container_type == "quality_changes": + old_container = global_stack.qualityChanges + elif container_type == "definition_changes": + old_container = global_stack.definitionChanges + # old_container = global_stack.findContainer({"type": container_type}) if old_container.getId() == old_id: changes_index = global_stack.getContainerIndex(old_container) global_stack.replaceContainer(changes_index, container)