diff options
author | Konstantinos Karmas <konskarm@gmail.com> | 2021-01-08 18:00:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 18:00:52 +0300 |
commit | 9562dc01f47bc1b3a368fa80563677a914bb09a0 (patch) | |
tree | d5d67c241a8379add896f1ce310b626837b822c8 | |
parent | faee42a94e443e69865e1bec026e60cdcbefce41 (diff) | |
parent | 01648a329e225795b7fb7a4c74a0755da82df69b (diff) |
Merge pull request #8718 from Ultimaker/speed_up_container_tree
Simplify and speed up the extending of the qualities list
-rw-r--r-- | cura/Machines/MaterialNode.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cura/Machines/MaterialNode.py b/cura/Machines/MaterialNode.py index c78c6aff03..18db7d982d 100644 --- a/cura/Machines/MaterialNode.py +++ b/cura/Machines/MaterialNode.py @@ -88,8 +88,10 @@ class MaterialNode(ContainerNode): variant = self.variant.variant_name) else: qualities_any_material = container_registry.findInstanceContainersMetadata(type = "quality", definition = self.variant.machine.quality_definition) - for material_metadata in container_registry.findInstanceContainersMetadata(type = "material", material = my_material_type): - qualities.extend((quality for quality in qualities_any_material if quality.get("material") == material_metadata["base_file"])) + + all_material_base_files = {material_metadata["base_file"] for material_metadata in container_registry.findInstanceContainersMetadata(type = "material", material = my_material_type)} + + qualities.extend((quality for quality in qualities_any_material if quality.get("material") in all_material_base_files)) if not qualities: # No quality profiles found. Go by GUID then. my_guid = self.guid |