From d5cfca4df00f71269d1b6107050f0c763134e207 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Mon, 13 Jan 2020 13:44:51 +0100 Subject: [PATCH] Fix loading machine specific materials The container registry was incorrectly being searched with a variant_name == None, which always returned an empty printer-specific materials list. As a result, the generic material settings were always being loaded if there was no variant specifically indicated inside the fdm_material file. The printer specific values were consistently being ignored. This commit fixes that by removing the search with a variant_name==None which correctly returns the printer-specific materials list while loading the materials from the variant nodes. CURA-7087 --- cura/Machines/VariantNode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Machines/VariantNode.py b/cura/Machines/VariantNode.py index 550b5881a3..0f30782a91 100644 --- a/cura/Machines/VariantNode.py +++ b/cura/Machines/VariantNode.py @@ -51,7 +51,7 @@ class VariantNode(ContainerNode): # Find all the materials for this variant's name. else: # Printer has its own material profiles. Look for material profiles with this printer's definition. base_materials = container_registry.findInstanceContainersMetadata(type = "material", definition = "fdmprinter") - printer_specific_materials = container_registry.findInstanceContainersMetadata(type = "material", definition = self.machine.container_id, variant_name = None) + printer_specific_materials = container_registry.findInstanceContainersMetadata(type = "material", definition = self.machine.container_id) variant_specific_materials = container_registry.findInstanceContainersMetadata(type = "material", definition = self.machine.container_id, variant_name = self.variant_name) # If empty_variant, this won't return anything. materials_per_base_file = {material["base_file"]: material for material in base_materials} materials_per_base_file.update({material["base_file"]: material for material in printer_specific_materials}) # Printer-specific profiles override global ones.