Update MaterialNode initialization and metadata retrieval

Although this is rare scenario.This allows for metadata retrieval from the container directly if one is provided, otherwise metadata is fetched using the container_id from the ContainerRegistry. Updated the MaterialNode creation in the VariantNode class(only one scenario) to pass the container.

CURA-11748
This commit is contained in:
Saumya Jain 2024-04-04 13:19:32 +02:00
parent da8db6201e
commit b944e35c25
2 changed files with 14 additions and 7 deletions

View file

@ -148,7 +148,7 @@ class VariantNode(ContainerNode):
if "empty_material" in self.materials:
del self.materials["empty_material"]
self.materials[base_file] = MaterialNode(container.getId(), variant = self)
self.materials[base_file] = MaterialNode(container.getId(), variant = self, container = container)
self.materials[base_file].materialChanged.connect(self.materialsChanged)
self.materialsChanged.emit(self.materials[base_file])