From 01c0472872bcd5580deaf8e8a67ac5bc210e533f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 26 Aug 2019 15:49:52 +0200 Subject: [PATCH] Don't create container tree for extruder definitions That wouldn't work properly anyway, but it still took quite a lot of time to create these. Contributes to issue CURA-6600. --- cura/Machines/ContainerTree.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cura/Machines/ContainerTree.py b/cura/Machines/ContainerTree.py index 67e5d9fe62..4fe649610e 100644 --- a/cura/Machines/ContainerTree.py +++ b/cura/Machines/ContainerTree.py @@ -5,11 +5,12 @@ from UM.Logger import Logger from UM.Settings.ContainerRegistry import ContainerRegistry # To listen to containers being added. from UM.Settings.DefinitionContainer import DefinitionContainer from UM.Settings.Interfaces import ContainerInterface -import cura.CuraApplication # Imported like this to prevent circular dependencies. from UM.Signal import Signal +import cura.CuraApplication # Imported like this to prevent circular dependencies. from cura.Machines.MachineNode import MachineNode +from cura.Settings.GlobalStack import GlobalStack # To listen only to global stacks being added. -from typing import Dict, List, TYPE_CHECKING +from typing import Dict, TYPE_CHECKING import time if TYPE_CHECKING: @@ -63,6 +64,8 @@ class ContainerTree: start_time = time.time() all_stacks = ContainerRegistry.getInstance().findContainerStacks() for stack in all_stacks: + if not isinstance(stack, GlobalStack): + continue # Only want to load global stacks. We don't need to create a tree for extruder definitions. definition_id = stack.definition.getId() if definition_id not in self.machines: self.machines[definition_id] = MachineNode(definition_id)