mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-11 16:00:47 -07:00
Merge branch '2.5' of github.com:Ultimaker/Cura into 2.5
This commit is contained in:
commit
76c1c31cf4
1 changed files with 6 additions and 1 deletions
|
|
@ -255,7 +255,12 @@ class ExtruderManager(QObject):
|
||||||
|
|
||||||
preferred_materials = container_registry.findInstanceContainers(**search_criteria)
|
preferred_materials = container_registry.findInstanceContainers(**search_criteria)
|
||||||
if len(preferred_materials) >= 1:
|
if len(preferred_materials) >= 1:
|
||||||
material = preferred_materials[0]
|
# In some cases we get multiple materials. In that case, prefer materials that are marked as read only.
|
||||||
|
read_only_preferred_materials = [preferred_material for preferred_material in preferred_materials if preferred_material.isReadOnly()]
|
||||||
|
if len(read_only_preferred_materials) >= 1:
|
||||||
|
material = read_only_preferred_materials[0]
|
||||||
|
else:
|
||||||
|
material = preferred_materials[0]
|
||||||
else:
|
else:
|
||||||
Logger.log("w", "The preferred material \"%s\" of machine %s doesn't exist or is not a material profile.", preferred_material_id, machine_id)
|
Logger.log("w", "The preferred material \"%s\" of machine %s doesn't exist or is not a material profile.", preferred_material_id, machine_id)
|
||||||
# And leave it at the default material.
|
# And leave it at the default material.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue