From 3d44d3c4caf1db536048382f4aa6a1cbe578d904 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 23 Aug 2017 17:42:39 +0200 Subject: [PATCH] Add logging and minor fix for project loading CURA-4204 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 6c6451c4c4..3eb224fb15 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -832,8 +832,9 @@ class ThreeMFWorkspaceReader(WorkspaceReader): # replace old material in global and extruder stacks with new self._replaceStackMaterialWithNew(global_stack, old_to_new_material_dict) - for each_extruder_stack in extruder_stacks: - self._replaceStackMaterialWithNew(each_extruder_stack, old_to_new_material_dict) + if extruder_stacks: + for each_extruder_stack in extruder_stacks: + self._replaceStackMaterialWithNew(each_extruder_stack, old_to_new_material_dict) if extruder_stacks: for stack in extruder_stacks: @@ -899,6 +900,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader): best_matching_old_material_id = old_parent_material_id if best_matching_old_material_id is None: + Logger.log("w", "Cannot find any matching old material ID for stack [%s] material [%s]. Something can go wrong", + stack.getId(), old_material_id_in_stack) return # find the new material container