mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 01:07:52 -06:00
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:
parent
9f84304829
commit
7348c70af6
7 changed files with 14 additions and 15 deletions
|
@ -37,18 +37,18 @@ class MaterialBrandsModel(BaseMaterialsModel):
|
|||
# Part 1: Generate the entire tree of brands -> material types -> spcific materials
|
||||
for root_material_id, container_node in self._available_materials.items():
|
||||
# Do not include the materials from a to-be-removed package
|
||||
if bool(container_node.container.getMetaDataEntry("removed", False)):
|
||||
if bool(container_node.getMetaDataEntry("removed", False)):
|
||||
continue
|
||||
|
||||
# Add brands we haven't seen yet to the dict, skipping generics
|
||||
brand = container_node.container.getMetaDataEntry("brand", "")
|
||||
brand = container_node.getMetaDataEntry("brand", "")
|
||||
if brand.lower() == "generic":
|
||||
continue
|
||||
if brand not in brand_group_dict:
|
||||
brand_group_dict[brand] = {}
|
||||
|
||||
# Add material types we haven't seen yet to the dict
|
||||
material_type = container_node.container.getMetaDataEntry("material", "")
|
||||
material_type = container_node.getMetaDataEntry("material", "")
|
||||
if material_type not in brand_group_dict[brand]:
|
||||
brand_group_dict[brand][material_type] = []
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue