mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Assume that the tree is always constructed after metadata has been loaded
Safe assumption, since the tree can only start constructing after the stacks are loaded. Contributes to issue CURA-6600.
This commit is contained in:
parent
b46d4eb2b5
commit
bc3300baa8
2 changed files with 4 additions and 6 deletions
|
@ -27,12 +27,11 @@ class VariantNode(ContainerNode):
|
|||
self.materials = {} # type: Dict[str, MaterialNode] # Mapping material base files to their nodes.
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
self.variant_name = container_registry.findContainersMetadata(id = container_id)[0]["name"] #Store our own name so that we can filter more easily.
|
||||
container_registry.allMetadataLoaded.connect(self._reloadAll)
|
||||
container_registry.containerAdded.connect(self._materialAdded)
|
||||
self._reloadAll()
|
||||
self._loadAll()
|
||||
|
||||
## (Re)loads all materials under this variant.
|
||||
def _reloadAll(self):
|
||||
def _loadAll(self):
|
||||
container_registry = ContainerRegistry.getInstance()
|
||||
# Find all the materials for this variant's name.
|
||||
if not self.parent.has_machine_materials: # Printer has no specific materials. Look for all fdmprinter materials.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue