Fix getting available materials without material manager

It's a bit weird still that this is executed in the _canUpdate... Oh well.

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-08-21 17:01:29 +02:00
parent 4ad6f4f635
commit 5d76f96354
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -131,7 +131,7 @@ class BaseMaterialsModel(ListModel):
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)
materials = ContainerTree.getInstance().machines[global_stack.definition.getId()].variants[nozzle_name].materials
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