mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Don't show invisible materials in material selection
CURA-10953
This commit is contained in:
parent
331ff75315
commit
1a41f2650a
2 changed files with 7 additions and 0 deletions
|
@ -44,6 +44,10 @@ class MaterialBrandsModel(BaseMaterialsModel):
|
||||||
if bool(container_node.getMetaDataEntry("removed", False)):
|
if bool(container_node.getMetaDataEntry("removed", False)):
|
||||||
continue
|
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
|
# Add brands we haven't seen yet to the dict, skipping generics
|
||||||
brand = container_node.getMetaDataEntry("brand", "")
|
brand = container_node.getMetaDataEntry("brand", "")
|
||||||
if brand.lower() == "generic":
|
if brand.lower() == "generic":
|
||||||
|
|
|
@ -910,6 +910,9 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
base_metadata["properties"] = property_values
|
base_metadata["properties"] = property_values
|
||||||
base_metadata["definition"] = "fdmprinter"
|
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)
|
compatible_entries = data.iterfind("./um:settings/um:setting[@key='hardware compatible']", cls.__namespaces)
|
||||||
try:
|
try:
|
||||||
common_compatibility = cls._parseCompatibleValue(next(compatible_entries).text) # type: ignore
|
common_compatibility = cls._parseCompatibleValue(next(compatible_entries).text) # type: ignore
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue