Write active material metadata to ufp when saving.

Add function to fetch package_id using only information from XmlMaterialProfile material container.
The only piece of information associating the material container and the package together is the file_name. To find the package that owns a material we have to search each of the material package paths.

It would be great to find a cleaner solution (preferable one that doesn't require invalidating the cached containers).

CURA-8610
This commit is contained in:
j.delarago 2022-05-30 17:29:59 +02:00
parent 596c24657d
commit 21d59e9349
3 changed files with 69 additions and 19 deletions

View file

@ -343,6 +343,9 @@ class XmlMaterialProfile(InstanceContainer):
return stream.getvalue().decode("utf-8")
def getFileName(self):
return self.getMetaDataEntry("base_file") + ".xml.fdm_material"
# Recursively resolve loading inherited files
def _resolveInheritance(self, file_name):
xml = self._loadFile(file_name)