From 2c8b9290f84e7671c0cc6e421a1bea8ae3852000 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 31 Aug 2016 11:41:33 +0200 Subject: [PATCH] Made checking if inheritance is allowed more explicit CURA-2108 --- cura/Settings/MachineManager.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 348ce6a49c..91cfd5e811 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -838,15 +838,16 @@ class MachineManager(QObject): # that are assigned to the parents of this material profile. try: inherited_files = material_container.getInheritedFiles() - if inherited_files: - for inherited_file in inherited_files: - # Extract the ID from the path we used to load the file. - search_criteria["material"] = os.path.basename(inherited_file).split(".")[0] - containers = container_registry.findInstanceContainers(**search_criteria) - if containers: - return containers[0] except AttributeError: # Material_container does not support inheritance. - pass + inherited_files = [] + + if inherited_files: + for inherited_file in inherited_files: + # Extract the ID from the path we used to load the file. + search_criteria["material"] = os.path.basename(inherited_file).split(".")[0] + containers = container_registry.findInstanceContainers(**search_criteria) + if containers: + return containers[0] # We still weren't able to find a quality for this specific material. # Try to find qualities for a generic version of the material.