mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 13:17:51 -06:00
Fx containerAdded handling in VariantNode
CURA-6889
This commit is contained in:
parent
096b6431c5
commit
577365cf96
1 changed files with 8 additions and 0 deletions
|
@ -101,6 +101,14 @@ class VariantNode(ContainerNode):
|
||||||
def _materialAdded(self, container: ContainerInterface) -> None:
|
def _materialAdded(self, container: ContainerInterface) -> None:
|
||||||
if container.getMetaDataEntry("type") != "material":
|
if container.getMetaDataEntry("type") != "material":
|
||||||
return # Not interested.
|
return # Not interested.
|
||||||
|
if not ContainerRegistry.getInstance().findContainersMetadata(id = container.getId()):
|
||||||
|
# CURA-6889
|
||||||
|
# containerAdded and removed signals may be triggered in the next event cycle. If a container gets added
|
||||||
|
# and removed in the same event cycle, in the next cycle, the connections should just ignore the signals.
|
||||||
|
# The check here makes sure that the container in the signal still exists.
|
||||||
|
Logger.log("d", "Got container added signal for container [%s] but it no longer exists, do nothing.",
|
||||||
|
container.getId())
|
||||||
|
return
|
||||||
if not self.machine.has_materials:
|
if not self.machine.has_materials:
|
||||||
return # We won't add any materials.
|
return # We won't add any materials.
|
||||||
material_definition = container.getMetaDataEntry("definition")
|
material_definition = container.getMetaDataEntry("definition")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue