mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
Don't require material manager any more to find available materials
We have our container tree for that. Contributes to issue CURA-6600.
This commit is contained in:
parent
e7609fadf4
commit
b7213ad020
1 changed files with 8 additions and 1 deletions
|
@ -115,7 +115,14 @@ class BaseMaterialsModel(ListModel):
|
|||
return False
|
||||
extruder_stack = global_stack.extruders[extruder_position]
|
||||
|
||||
self._available_materials = self._material_manager.getAvailableMaterialsForMachineExtruder(global_stack, extruder_stack)
|
||||
nozzle_name = None
|
||||
if extruder_stack.variant.getId() != "empty_variant":
|
||||
nozzle_name = extruder_stack.variant.getName()
|
||||
|
||||
# Update the available materials (ContainerNode) for the current active machine and extruder setup.
|
||||
materials = self.getAvailableMaterials(global_stack.definition.getId(), nozzle_name)
|
||||
compatible_material_diameter = str(round(extruder_stack.getCompatibleMaterialDiameter()))
|
||||
self._available_materials = {key: material for key, material in materials.items() if material.container.getMetaDataEntry("approximate_diameter") == compatible_material_diameter}
|
||||
return True
|
||||
|
||||
## This is another convenience function which is shared by all material
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue