From fa1f5a7c89e218f3b82f774939491c610f639f11 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Fri, 20 Oct 2023 15:10:39 +0200 Subject: [PATCH] Boyscouting CURA-11189 --- cura/Settings/MachineManager.py | 10 ++++++++++ plugins/3MFReader/ThreeMFWorkspaceReader.py | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index b8a5e7d885..11b55e8507 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1700,6 +1700,16 @@ class MachineManager(QObject): else: # No intent had the correct category. extruder.intent = empty_intent_container + @pyqtSlot() + def resetIntents(self) -> None: + """Reset the intent category of the current printer. + """ + global_stack = self._application.getGlobalContainerStack() + if global_stack is None: + return + for extruder in global_stack.extruderList: + extruder.intent = empty_intent_container + def activeQualityGroup(self) -> Optional["QualityGroup"]: """Get the currently activated quality group. diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 10b38a9d69..4e3962fd10 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -1259,7 +1259,9 @@ class ThreeMFWorkspaceReader(WorkspaceReader): available_intent_category_list = IntentManager.getInstance().currentAvailableIntentCategories() if self._intent_category_to_apply is not None and self._intent_category_to_apply in available_intent_category_list: machine_manager.setIntentByCategory(self._intent_category_to_apply) - + else: + # if no intent is provided, reset to the default (balanced) intent + machine_manager.resetIntents() # Notify everything/one that is to notify about changes. global_stack.containersChanged.emit(global_stack.getTop())