mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Use variant node's preferredMaterial function from MaterialManager too
We can reuse that code. Contributes to issue CURA-6600.
This commit is contained in:
parent
0302ae4257
commit
81a33af3aa
1 changed files with 1 additions and 5 deletions
|
@ -242,11 +242,7 @@ class MaterialManager(QObject):
|
||||||
if nozzle_name not in machine_node.variants:
|
if nozzle_name not in machine_node.variants:
|
||||||
Logger.log("w", "Could not find variant {nozzle_name} for machine with definition {definition_id} in the container tree".format(nozzle_name = nozzle_name, definition_id = definition_id))
|
Logger.log("w", "Could not find variant {nozzle_name} for machine with definition {definition_id} in the container tree".format(nozzle_name = nozzle_name, definition_id = definition_id))
|
||||||
return None
|
return None
|
||||||
available_materials = machine_node.variants[nozzle_name].materials
|
return machine_node.variants[nozzle_name].preferredMaterial(approximate_material_diameter)
|
||||||
for base_material, material_node in available_materials.items():
|
|
||||||
if machine_node.preferred_material in base_material and approximate_material_diameter == int(material_node.getMetaDataEntry("approximate_diameter")):
|
|
||||||
return material_node
|
|
||||||
return None
|
|
||||||
|
|
||||||
def removeMaterialByRootId(self, root_material_id: str):
|
def removeMaterialByRootId(self, root_material_id: str):
|
||||||
container_registry = CuraContainerRegistry.getInstance()
|
container_registry = CuraContainerRegistry.getInstance()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue