diff --git a/cura/Machines/ContainerNode.py b/cura/Machines/ContainerNode.py index 32ebe203a3..74d08dff6c 100644 --- a/cura/Machines/ContainerNode.py +++ b/cura/Machines/ContainerNode.py @@ -24,6 +24,7 @@ class ContainerNode: self.children_map = {} # type: Dict[str, ContainerNode] # Mapping from container ID to container node. ## Gets the metadata of the container that this node represents. + # Getting the metadata from the container directly is about 10x as fast. # \return The metadata of the container in this node. @deprecated("Get the metadata from the container with the ID of this node yourself.", "4.3") def getMetadata(self): diff --git a/cura/Machines/MaterialManager.py b/cura/Machines/MaterialManager.py index 4790314b25..72862d43f0 100644 --- a/cura/Machines/MaterialManager.py +++ b/cura/Machines/MaterialManager.py @@ -1,6 +1,5 @@ # Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. - from collections import defaultdict import copy import uuid @@ -109,10 +108,10 @@ class MaterialManager(QObject): nozzle_name = extruder_stack.variant.getName() # Fetch the available materials (ContainerNode) for the current active machine and extruder setup. - materials =self.getAvailableMaterials(machine.definition.getId(), nozzle_name) + materials = self.getAvailableMaterials(machine.definition.getId(), nozzle_name) compatible_material_diameter = str(round(extruder_stack.getCompatibleMaterialDiameter())) - - return {key: material for key, material in materials.items() if material.getMetaDataEntry("approximate_diameter") == compatible_material_diameter} + result = {key: material for key, material in materials.items() if material.container.getMetaDataEntry("approximate_diameter") == compatible_material_diameter} + return result # # Gets MaterialNode for the given extruder and machine with the given material name.