diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 58a948c17b..5382dd8b01 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -275,7 +275,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer): # The XML material profile can have specific settings for machines. # Some machines share profiles, so they are only created once. # This function duplicates those elements so that each machine tag only has one identifier. - def _flattenMachinesXML(self, element): + def _expandMachinesXML(self, element): settings_element = element.find("./um:settings", self.__namespaces) machines = settings_element.iterfind("./um:machine", self.__namespaces) machines_to_add = [] @@ -309,7 +309,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer): def _mergeXML(self, first, second): result = copy.deepcopy(first) - self._combineElement(self._flattenMachinesXML(result), self._flattenMachinesXML(second)) + self._combineElement(self._expandMachinesXML(result), self._expandMachinesXML(second)) return result def _createKey(self, element): @@ -339,7 +339,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer): key = self._createKey(element) if len(element): # Check if element has children. try: - if "setting " in key: + if "setting" in element.tag and not "settings" in element.tag: # Setting can have points in it. In that case, delete all values and override them. for child in list(mapping[key]): mapping[key].remove(child)