From fc0b8185b7df0f223a67f24384e3e6bad663c8a1 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 22 Oct 2019 11:37:33 +0200 Subject: [PATCH] Fix setMetaDataEntry() dependency on ContainerRegistery CURA-6920 --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index fe0f73f2b3..093638d594 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -76,7 +76,9 @@ class XmlMaterialProfile(InstanceContainer): new_setting_values_dict[self.__material_properties_setting_map[k]] = v if not apply_to_all: # Historical: If you only want to modify THIS container. We only used that to prevent recursion but with the below code that's no longer necessary. - container_query = registry.findContainers(id = self.getId()) + # CURA-6920: This is an optimization, but it also fixes the problem that you can only set metadata for a + # material container that can be found in the container registry. + container_query = [self] else: container_query = registry.findContainers(base_file = self.getMetaDataEntry("base_file"))