From 999e19940e40539c4d13808b1fcbf0edd9a6c78c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 22 Aug 2019 15:43:16 +0200 Subject: [PATCH] Also don't add any materials added later if there are no materials Keeps it consistent. Contributes to issue CURA-6600. --- cura/Machines/VariantNode.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cura/Machines/VariantNode.py b/cura/Machines/VariantNode.py index d4b9831f66..c02bfab1a5 100644 --- a/cura/Machines/VariantNode.py +++ b/cura/Machines/VariantNode.py @@ -85,10 +85,13 @@ class VariantNode(ContainerNode): def _materialAdded(self, container: ContainerInterface): if container.getMetaDataEntry("type") != "material": return # Not interested. + if not self.machine.has_materials: + return # We won't add any materials. material_definition = container.getMetaDataEntry("definition") if not self.machine.has_machine_materials: if material_definition != "fdmprinter": return + base_file = container.getMetaDataEntry("base_file") if base_file in self.machine.exclude_materials: return # Material is forbidden for this printer.