Make quality manager also include profiles with same GUID in fallback.

This ensures that if a (duplicated) material does not have a generic variant, that
the material it was copied from will be added to the fallback list.

CURA-5898
This commit is contained in:
Jaime van Kessel 2018-11-05 11:17:39 +01:00
parent 90726ecbff
commit eded0f0297
2 changed files with 31 additions and 7 deletions

View file

@ -259,11 +259,13 @@ class QualityManager(QObject):
root_material_id = self._material_manager.getRootMaterialIDWithoutDiameter(root_material_id)
root_material_id_list.append(root_material_id)
# Also try to get the fallback material
material_type = extruder.material.getMetaDataEntry("material")
fallback_root_material_id = self._material_manager.getFallbackMaterialIdByMaterialType(material_type)
if fallback_root_material_id:
root_material_id_list.append(fallback_root_material_id)
# Also try to get the fallback materials
fallback_ids = self._material_manager.getFallBackMaterialIdsByMaterial(extruder.material)
if fallback_ids:
root_material_id_list.extend(fallback_ids)
root_material_id_list = list(set(root_material_id_list)) # Weed out duplicates
# Here we construct a list of nodes we want to look for qualities with the highest priority first.
# The use case is that, when we look for qualities for a machine, we first want to search in the following