Add a function to add a MachineNode to the tree.

This solves the issue that machines created by the stack builder broke the material updating

CURA-6791
This commit is contained in:
Jaime van Kessel 2019-09-23 13:18:11 +02:00
parent 5b5256b9e4
commit 7e3f265068
No known key found for this signature in database
GPG key ID: 3710727397403C91
2 changed files with 16 additions and 12 deletions

View file

@ -40,8 +40,7 @@ class CuraStackBuilder:
# The container tree listens to the containerAdded signal to add the definition and build the tree,
# but that signal is emitted with a delay which might not have passed yet.
# Therefore we must make sure that it's manually added here.
if machine_definition.getId() not in container_tree.machines:
container_tree.machines[machine_definition.getId()] = MachineNode(machine_definition.getId())
container_tree.addMachineNodeByDefinitionId(machine_definition.getId())
machine_node = container_tree.machines[machine_definition.getId()]
generated_name = registry.createUniqueName("machine", "", name, machine_definition.getName())