mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-19 22:09:15 +08:00
Fix the filtering of materials based on exclude_materials
CURA-6600
This commit is contained in:
parent
fa077038fc
commit
6e5b0bb609
@ -46,11 +46,12 @@ class VariantNode(ContainerNode):
|
|||||||
materials_per_base_file.update({material["base_file"]: material for material in variant_specific_materials}) # Variant-specific profiles override all of those.
|
materials_per_base_file.update({material["base_file"]: material for material in variant_specific_materials}) # Variant-specific profiles override all of those.
|
||||||
materials = materials_per_base_file.values()
|
materials = materials_per_base_file.values()
|
||||||
|
|
||||||
for excluded_material in self.machine.exclude_materials:
|
filtered_materials = []
|
||||||
if excluded_material in materials:
|
|
||||||
del materials[excluded_material]
|
|
||||||
|
|
||||||
for material in materials:
|
for material in materials:
|
||||||
|
if material["id"] not in self.machine.exclude_materials:
|
||||||
|
filtered_materials.append(material)
|
||||||
|
|
||||||
|
for material in filtered_materials:
|
||||||
base_file = material["base_file"]
|
base_file = material["base_file"]
|
||||||
if base_file not in self.materials:
|
if base_file not in self.materials:
|
||||||
self.materials[base_file] = MaterialNode(material["id"], variant = self)
|
self.materials[base_file] = MaterialNode(material["id"], variant = self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user