Browse Source

Boyscouting

CURA-11189
c.lamboo 1 year ago
parent
commit
fa1f5a7c89
2 changed files with 13 additions and 1 deletions
  1. 10 0
      cura/Settings/MachineManager.py
  2. 3 1
      plugins/3MFReader/ThreeMFWorkspaceReader.py

+ 10 - 0
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.
 

+ 3 - 1
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())