Don't get whole container to just get metadata

A performance improvement, especially in the material models.

Contributes to issue CURA-6793.
This commit is contained in:
Ghostkeeper 2019-10-16 13:56:23 +02:00
parent 9f84304829
commit 7348c70af6
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
7 changed files with 14 additions and 15 deletions

View file

@ -132,7 +132,7 @@ class MaterialManager(QObject):
# Fetch the available materials (ContainerNode) for the current active machine and extruder setup.
materials = self.getAvailableMaterials(machine.definition.getId(), nozzle_name)
compatible_material_diameter = extruder_stack.getApproximateMaterialDiameter()
result = {key: material for key, material in materials.items() if material.container and float(material.container.getMetaDataEntry("approximate_diameter")) == compatible_material_diameter}
result = {key: material for key, material in materials.items() if material.container and float(material.getMetaDataEntry("approximate_diameter")) == compatible_material_diameter}
return result
#