Skip to content

Commit

Permalink
Don't show invisible materials in material selection
Browse files Browse the repository at this point in the history
CURA-10953
  • Loading branch information
nallath committed Sep 7, 2023
1 parent 331ff75 commit 1a41f26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cura/Machines/Models/MaterialBrandsModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def _update(self):
if bool(container_node.getMetaDataEntry("removed", False)):
continue

# Ignore materials that are marked as not visible for whatever reason
if not bool(container_node.getMetaDataEntry("visible", True)):
continue

# Add brands we haven't seen yet to the dict, skipping generics
brand = container_node.getMetaDataEntry("brand", "")
if brand.lower() == "generic":
Expand Down
3 changes: 3 additions & 0 deletions plugins/XmlMaterialProfile/XmlMaterialProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,9 @@ def deserializeMetadata(cls, serialized: str, container_id: str) -> List[Dict[st
base_metadata["properties"] = property_values
base_metadata["definition"] = "fdmprinter"

# Certain materials are loaded but should not be visible / selectable to the user.
base_metadata["visible"] = not property_values.get("abstract_color", False)

compatible_entries = data.iterfind("./um:settings/um:setting[@key='hardware compatible']", cls.__namespaces)
try:
common_compatibility = cls._parseCompatibleValue(next(compatible_entries).text) # type: ignore
Expand Down

0 comments on commit 1a41f26

Please sign in to comment.