mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Consolidate models some more
Contributes to CURA-5162, CURA-5378
This commit is contained in:
parent
56a5f59964
commit
6be9b5e27f
4 changed files with 44 additions and 56 deletions
|
@ -25,26 +25,15 @@ class GenericMaterialsModel(BaseMaterialsModel):
|
|||
for root_material_id, container_node in self._available_materials.items():
|
||||
metadata = container_node.metadata
|
||||
|
||||
# Only add results for generic materials
|
||||
if metadata["brand"].lower() != "generic":
|
||||
continue
|
||||
|
||||
# Do not include the materials from a to-be-removed package
|
||||
if bool(metadata.get("removed", False)):
|
||||
continue
|
||||
|
||||
item = {
|
||||
"root_material_id": root_material_id,
|
||||
"id": metadata["id"],
|
||||
"GUID": metadata["GUID"],
|
||||
"name": metadata["name"],
|
||||
"brand": metadata["brand"],
|
||||
"material": metadata["material"],
|
||||
"color_name": metadata["color_name"],
|
||||
"color_code": metadata["color_code"],
|
||||
"container_node": container_node,
|
||||
"is_favorite": root_material_id in self._favorite_ids
|
||||
}
|
||||
# Only add results for generic materials
|
||||
if metadata["brand"].lower() != "generic":
|
||||
continue
|
||||
|
||||
item = self._createMaterialItem(root_material_id, container_node)
|
||||
item_list.append(item)
|
||||
|
||||
# Sort the item list alphabetically by name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue