mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-14 02:33:14 +08:00
Don't show invisible materials in material selection
CURA-10953
This commit is contained in:
parent
331ff75315
commit
1a41f2650a
@ -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…
x
Reference in New Issue
Block a user