mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 06:33:55 -06:00
Don't add materials forbidden by the printer definition
Contributes to issue CURA-6600.
This commit is contained in:
parent
3ef0b4292d
commit
24346fc8e3
2 changed files with 8 additions and 1 deletions
|
@ -45,6 +45,9 @@ 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 = materials_per_base_file.values()
|
||||
|
||||
for excluded_material in self.parent.exclude_materials:
|
||||
del materials[excluded_material]
|
||||
|
||||
for material in materials:
|
||||
base_file = material["base_file"]
|
||||
if base_file not in self.materials:
|
||||
|
@ -60,6 +63,8 @@ class VariantNode(ContainerNode):
|
|||
if material_definition != "fdmprinter":
|
||||
return
|
||||
base_file = container.getMetaDataEntry("base_file")
|
||||
if base_file in self.parent.exclude_materials:
|
||||
return # Material is forbidden for this printer.
|
||||
if base_file not in self.materials: # Completely new base file. Always better than not having a file as long as it matches our set-up.
|
||||
if material_definition != "fdmprinter" and material_definition != self.parent.container_id:
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue