From 8699a407de924f11faee6b3a637947e82bef067a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 4 Jul 2019 09:09:22 +0200 Subject: [PATCH 1/3] Filter on 'material' metadata instead of material_id This is consistent with how the material is stored in other profiles, such as quality profiles. Contributes to issue CURA-6597. --- cura/Settings/IntentManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/IntentManager.py b/cura/Settings/IntentManager.py index e16115ba2a..51aafb0f7a 100644 --- a/cura/Settings/IntentManager.py +++ b/cura/Settings/IntentManager.py @@ -43,7 +43,7 @@ class IntentManager(QObject): # an empty list if nothing was found. def intentMetadatas(self, definition_id: str, nozzle_name: str, material_id: str) -> List[Dict[str, Any]]: registry = CuraApplication.getInstance().getContainerRegistry() - return registry.findContainersMetadata(definition = definition_id, variant = nozzle_name, material_id = material_id) + return registry.findContainersMetadata(definition = definition_id, variant = nozzle_name, material = material_id) ## Collects and returns all intent categories available for the given # parameters. Note that the 'default' category is always available. From 7518b7feb02bb7e1ef76f74275e80fc490a9f1d8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 4 Jul 2019 09:14:06 +0200 Subject: [PATCH 2/3] Get intents for every active extruder, not every used extruder We want the intents for basically any extruder, not just the one that would get used by a slice using the current settings for extruder_nr. Contributes to issue CURA-6597. --- cura/Settings/IntentManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/Settings/IntentManager.py b/cura/Settings/IntentManager.py index 51aafb0f7a..54324535dd 100644 --- a/cura/Settings/IntentManager.py +++ b/cura/Settings/IntentManager.py @@ -73,13 +73,13 @@ class IntentManager(QObject): return [("default", "normal")] # TODO: We now do this (return a default) if the global stack is missing, but not in the code below, # even though there should always be defaults. The problem then is what to do with the quality_types. - # Currently _also_ inconsistent with 'currentAvailableIntentCategoreis', which _does_ return default. + # Currently _also_ inconsistent with 'currentAvailableIntentCategories', which _does_ return default. quality_groups = application.getQualityManager().getQualityGroups(global_stack) available_quality_types = {quality_group.quality_type for quality_group in quality_groups.values() if quality_group.node_for_global is not None} final_intent_ids = set() # type: Set[str] current_definition_id = global_stack.definition.getMetaDataEntry("id") - for extruder_stack in ExtruderManager.getInstance().getUsedExtruderStacks(): + for extruder_stack in ExtruderManager.getInstance().getActiveExtruderStacks(): nozzle_name = extruder_stack.variant.getMetaDataEntry("name") material_id = extruder_stack.material.getMetaDataEntry("base_file") final_intent_ids |= {metadata["id"] for metadata in self.intentMetadatas(current_definition_id, nozzle_name, material_id) if metadata["quality_type"] in available_quality_types} From 1dd69fe441f92acab885752808f030809611827d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 4 Jul 2019 09:43:25 +0200 Subject: [PATCH 3/3] Only return intents from intentMetadatas Otherwise we also get quality profiles for the same printer... Contributes to issue CURA-6597. --- cura/Settings/IntentManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/IntentManager.py b/cura/Settings/IntentManager.py index 54324535dd..e80c03ce34 100644 --- a/cura/Settings/IntentManager.py +++ b/cura/Settings/IntentManager.py @@ -43,7 +43,7 @@ class IntentManager(QObject): # an empty list if nothing was found. def intentMetadatas(self, definition_id: str, nozzle_name: str, material_id: str) -> List[Dict[str, Any]]: registry = CuraApplication.getInstance().getContainerRegistry() - return registry.findContainersMetadata(definition = definition_id, variant = nozzle_name, material = material_id) + return registry.findContainersMetadata(type = "intent", definition = definition_id, variant = nozzle_name, material = material_id) ## Collects and returns all intent categories available for the given # parameters. Note that the 'default' category is always available.