From def7b6994daa4e25a4016fbde433cc3c16229b55 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 21 Nov 2017 12:50:10 +0100 Subject: [PATCH] Store correct ID in metadata after deserialising Contributes to issue CURA-4243. --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 7a2ad3fe51..5dfa130145 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -652,7 +652,8 @@ class XmlMaterialProfile(InstanceContainer): base_metadata = { "type": "material", "status": "unknown", #TODO: Add material verification. - "container_type": XmlMaterialProfile + "container_type": XmlMaterialProfile, + "id": container_id } try: @@ -751,6 +752,7 @@ class XmlMaterialProfile(InstanceContainer): new_material_metadata = {} new_material_metadata.update(base_metadata) + new_material_metadata["id"] = new_material_id new_material_metadata["compatible"] = machine_compatibility new_material_metadata["machine_manufacturer"] = machine_manufacturer @@ -790,6 +792,7 @@ class XmlMaterialProfile(InstanceContainer): new_hotend_material_metadata["variant"] = variant_containers[0]["id"] new_hotend_material_metadata["compatible"] = hotend_compatibility new_hotend_material_metadata["machine_manufacturer"] = machine_manufacturer + new_hotend_material_metadata["id"] = new_hotend_id if len(found_materials) == 0: result_metadata.append(new_hotend_material_metadata)