From f469b994716d596d756d6b56866eee3836fe922e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 24 Sep 2019 11:57:50 +0200 Subject: [PATCH] Create intent nodes based on the selected quality type Previously it would use the material type from the material, but since the material from the node can be different to that of the quality, we need to use the one from quality instead (This is due to the fallback system) CURA-6807 --- cura/Machines/QualityNode.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cura/Machines/QualityNode.py b/cura/Machines/QualityNode.py index 7980f4ed63..8bb2870ceb 100644 --- a/cura/Machines/QualityNode.py +++ b/cura/Machines/QualityNode.py @@ -23,15 +23,17 @@ class QualityNode(ContainerNode): my_metadata = ContainerRegistry.getInstance().findContainersMetadata(id = container_id)[0] self.quality_type = my_metadata["quality_type"] - + # The material type of the parent doesn't need to be the same as this due to generic fallbacks. + self._material = my_metadata.get("material") self._loadAll() def _loadAll(self) -> None: container_registry = ContainerRegistry.getInstance() + # Find all intent profiles that fit the current configuration. from cura.Machines.MachineNode import MachineNode if not isinstance(self.parent, MachineNode): # Not a global profile. - for intent in container_registry.findInstanceContainersMetadata(type = "intent", definition = self.parent.variant.machine.quality_definition, variant = self.parent.variant.variant_name, material = self.parent.base_file, quality_type = self.quality_type): + for intent in container_registry.findInstanceContainersMetadata(type = "intent", definition = self.parent.variant.machine.quality_definition, variant = self.parent.variant.variant_name, material = self._material, quality_type = self.quality_type): self.intents[intent["id"]] = IntentNode(intent["id"], quality = self) self.intents["empty_intent"] = IntentNode("empty_intent", quality = self)