mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 11:47:50 -06:00
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:
parent
c0fc0a7eba
commit
f712fc0f36
3 changed files with 6 additions and 3 deletions
|
@ -108,6 +108,8 @@ class BrandMaterialsModel(ListModel):
|
|||
# Only add results for generic materials
|
||||
if brand.lower() == "generic":
|
||||
continue
|
||||
if not metadata.get("compatible", True):
|
||||
continue
|
||||
|
||||
if brand not in brand_group_dict:
|
||||
brand_group_dict[brand] = {}
|
||||
|
@ -123,7 +125,7 @@ class BrandMaterialsModel(ListModel):
|
|||
"material": metadata["material"],
|
||||
"color_name": metadata["color_name"],
|
||||
"container_node": container_node,
|
||||
"compatible": metadata.get("compatible", "unknown")
|
||||
"compatible": metadata.get("compatible", True)
|
||||
}
|
||||
brand_group_dict[brand][material_type].append(item)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ Menu
|
|||
text: model.name
|
||||
checkable: true
|
||||
checked: model.root_material_id == Cura.MachineManager.currentRootMaterialId[extruderIndex]
|
||||
enabled: model.compatible
|
||||
exclusiveGroup: group
|
||||
onTriggered:
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue