mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 13:03:59 -06:00
Add function to find preferred quality profile
Not for global yet, so it doesn't appear as if anything is loaded yet. Contributes to issue CURA-6600.
This commit is contained in:
parent
557c3d9515
commit
fcab800a8d
3 changed files with 33 additions and 4 deletions
|
@ -71,12 +71,14 @@ class VariantNode(ContainerNode):
|
|||
## Finds the preferred material for this printer with this nozzle in one of
|
||||
# the extruders.
|
||||
#
|
||||
# If there is no material here (because the printer has no materials or
|
||||
# because there are no matching material profiles), None is returned.
|
||||
# If the preferred material is not available, an arbitrary material is
|
||||
# returned. If there is a configuration mistake (like a typo in the
|
||||
# preferred material) this returns a random available material. If there
|
||||
# are no available materials, this will return the empty material node.
|
||||
# \param approximate_diameter The desired approximate diameter of the
|
||||
# material.
|
||||
# \return The node for the preferred material, or None if there is no
|
||||
# match.
|
||||
# \return The node for the preferred material, or any arbitrary material
|
||||
# if there is no match.
|
||||
def preferredMaterial(self, approximate_diameter) -> MaterialNode:
|
||||
for base_material, material_node in self.materials.items():
|
||||
if self.machine.preferred_material in base_material and approximate_diameter == int(material_node.getMetaDataEntry("approximate_diameter")):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue