mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 04:15:12 +08:00
Merge pull request #19688 from Ultimaker/CURA-11634-Show-Any-Color-in-color-submenu
CURA-11634 Show any color in color submenu for machines that support it
This commit is contained in:
commit
383c102a63
@ -48,6 +48,7 @@ class MachineNode(ContainerNode):
|
||||
self.preferred_variant_name = my_metadata.get("preferred_variant_name", "")
|
||||
self.preferred_material = my_metadata.get("preferred_material", "")
|
||||
self.preferred_quality_type = my_metadata.get("preferred_quality_type", "")
|
||||
self.supports_abstract_color = parseBool(my_metadata.get("supports_abstract_color", "false"))
|
||||
|
||||
self._loadAll()
|
||||
|
||||
|
@ -63,6 +63,8 @@ class VariantNode(ContainerNode):
|
||||
filtered_materials = [material for material in materials if not self.machine.isExcludedMaterialBaseFile(material["id"])]
|
||||
|
||||
for material in filtered_materials:
|
||||
if material.get("abstract_color", False) and not self.machine.supports_abstract_color:
|
||||
continue # do not show abstract color profiles if the machine does not support them
|
||||
base_file = material["base_file"]
|
||||
if base_file not in self.materials:
|
||||
self.materials[base_file] = MaterialNode(material["id"], variant = self)
|
||||
@ -126,6 +128,8 @@ class VariantNode(ContainerNode):
|
||||
return # We won't add any materials.
|
||||
material_definition = container.getMetaDataEntry("definition")
|
||||
|
||||
if (not self.machine.supports_abstract_color) and container.getMetaDataEntry("abstract_color", False):
|
||||
return
|
||||
base_file = container.getMetaDataEntry("base_file")
|
||||
if self.machine.isExcludedMaterialBaseFile(base_file):
|
||||
return # Material is forbidden for this printer.
|
||||
|
@ -918,9 +918,6 @@ class XmlMaterialProfile(InstanceContainer):
|
||||
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 base_metadata.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
|
||||
|
@ -16,7 +16,8 @@
|
||||
"preferred_quality_type": "normal",
|
||||
"machine_extruder_trains": { "0": "fdmextruder" },
|
||||
"supports_usb_connection": true,
|
||||
"supports_network_connection": false
|
||||
"supports_network_connection": false,
|
||||
"supports_abstract_color": false
|
||||
},
|
||||
"settings":
|
||||
{
|
||||
|
@ -39,6 +39,7 @@
|
||||
"preferred_quality_type": "draft",
|
||||
"preferred_variant_name": "AA 0.4",
|
||||
"supported_actions": [ "DiscoverUM3Action" ],
|
||||
"supports_abstract_color": true,
|
||||
"supports_material_export": true,
|
||||
"supports_network_connection": true,
|
||||
"supports_usb_connection": false,
|
||||
|
@ -48,6 +48,7 @@
|
||||
"preferred_variant_buildplate_name": "Glass",
|
||||
"preferred_variant_name": "AA 0.4",
|
||||
"supported_actions": [ "DiscoverUM3Action" ],
|
||||
"supports_abstract_color": true,
|
||||
"supports_material_export": true,
|
||||
"supports_network_connection": true,
|
||||
"supports_usb_connection": false,
|
||||
|
@ -36,6 +36,7 @@
|
||||
"preferred_variant_name": "AA 0.4",
|
||||
"quality_definition": "ultimaker_s5",
|
||||
"supported_actions": [ "DiscoverUM3Action" ],
|
||||
"supports_abstract_color": true,
|
||||
"supports_material_export": true,
|
||||
"supports_network_connection": true,
|
||||
"supports_usb_connection": false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user