Set quality profiles to preferred quality upon stack creation

A good default.
Possible bug: If there are multiple matching quality profiles but the preferred quality profiles matches none or multiple of them, a random one is chosen. The random profile for the global stack may not match the random one for the extruder?

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-08-27 09:07:23 +02:00
parent fcab800a8d
commit 8f34b3dd73
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
2 changed files with 21 additions and 33 deletions

View file

@ -136,6 +136,15 @@ class MachineNode(ContainerNode):
return list(groups_by_name.values())
## Gets the preferred global quality node, going by the preferred quality
# type.
#
# If the preferred global quality is not in there, an arbitrary global
# quality is taken.
# If there are no global qualities, an empty quality is returned.
def preferredGlobalQuality(self) -> QualityNode:
return self.global_qualities.get(self.preferred_quality_type, next(iter(self.global_qualities)))
## (Re)loads all variants under this printer.
def _loadAll(self):
container_registry = ContainerRegistry.getInstance()