mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 03:37:48 -06:00
parent
376b6a53c9
commit
31e283110f
1 changed files with 13 additions and 9 deletions
|
@ -108,16 +108,20 @@ class CuraStackBuilder:
|
||||||
|
|
||||||
preferred_quality_type = machine_definition.getMetaDataEntry("preferred_quality_type")
|
preferred_quality_type = machine_definition.getMetaDataEntry("preferred_quality_type")
|
||||||
quality_group_dict = quality_manager.getQualityGroups(new_global_stack)
|
quality_group_dict = quality_manager.getQualityGroups(new_global_stack)
|
||||||
quality_group = quality_group_dict.get(preferred_quality_type)
|
if quality_group_dict: #There are any quality profiles.
|
||||||
|
if preferred_quality_type not in quality_group_dict:
|
||||||
|
Logger.log("w", "The preferred quality {quality_type} doesn't exist for this set-up. Choosing a random one.".format(quality_type = preferred_quality_type))
|
||||||
|
preferred_quality_type = next(iter(quality_group_dict))
|
||||||
|
quality_group = quality_group_dict.get(preferred_quality_type)
|
||||||
|
|
||||||
new_global_stack.quality = quality_group.node_for_global.getContainer()
|
new_global_stack.quality = quality_group.node_for_global.getContainer()
|
||||||
if not new_global_stack.quality:
|
if not new_global_stack.quality:
|
||||||
new_global_stack.quality = application.empty_quality_container
|
new_global_stack.quality = application.empty_quality_container
|
||||||
for position, extruder_stack in new_global_stack.extruders.items():
|
for position, extruder_stack in new_global_stack.extruders.items():
|
||||||
if position in quality_group.nodes_for_extruders and quality_group.nodes_for_extruders[position].getContainer():
|
if position in quality_group.nodes_for_extruders and quality_group.nodes_for_extruders[position].getContainer():
|
||||||
extruder_stack.quality = quality_group.nodes_for_extruders[position].getContainer()
|
extruder_stack.quality = quality_group.nodes_for_extruders[position].getContainer()
|
||||||
else:
|
else:
|
||||||
extruder_stack.quality = application.empty_quality_container
|
extruder_stack.quality = application.empty_quality_container
|
||||||
|
|
||||||
# Register the global stack after the extruder stacks are created. This prevents the registry from adding another
|
# Register the global stack after the extruder stacks are created. This prevents the registry from adding another
|
||||||
# extruder stack because the global stack didn't have one yet (which is enforced since Cura 3.1).
|
# extruder stack because the global stack didn't have one yet (which is enforced since Cura 3.1).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue