mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 04:29:01 +08:00
If we find multiple materials for a new extruder, prefer a read only material
CURA-3147
This commit is contained in:
parent
cd5e883010
commit
6314d872e1
@ -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…
x
Reference in New Issue
Block a user