No longer add incompatible materials to materials menus

This removes the need for the 'compatible' role but I'll keep it in for now in case we want to change the design of this later.

Contributes to issue CURA-5460.
This commit is contained in:
Ghostkeeper 2018-07-09 17:29:45 +02:00
parent c0fc0a7eba
commit f712fc0f36
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
3 changed files with 6 additions and 3 deletions

View file

@ -44,6 +44,8 @@ class GenericMaterialsModel(BaseMaterialsModel):
# Only add results for generic materials
if metadata["brand"].lower() != "generic":
continue
if not metadata.get("compatible", True):
continue
item = {"root_material_id": root_material_id,
"id": metadata["id"],
@ -52,7 +54,7 @@ class GenericMaterialsModel(BaseMaterialsModel):
"material": metadata["material"],
"color_name": metadata["color_name"],
"container_node": container_node,
"compatible": metadata.get("compatible", "unknown")
"compatible": metadata.get("compatible", True)
}
item_list.append(item)