diff options
author | Remco Burema <r.burema@ultimaker.com> | 2019-02-20 13:29:24 +0300 |
---|---|---|
committer | Remco Burema <r.burema@ultimaker.com> | 2019-02-20 13:29:24 +0300 |
commit | f81ad588368c332370829e5f40e99ffae7d2ec2a (patch) | |
tree | a0ae497858d50f64c7467fdfd15d2bda1c552f9a | |
parent | 9a1d8ea5f9d1922bfb050e2dd69d7d15501b2258 (diff) | |
parent | 7fca9dae04e2e949d33b1de2feab49c3d4f70334 (diff) |
Merge branch 'ppa_contribute_compatible_format' into 4.0
-rw-r--r-- | plugins/XmlMaterialProfile/XmlMaterialProfile.py | 6 | ||||
-rw-r--r-- | plugins/XmlMaterialProfile/product_to_id.json | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 7f31f93ac0..e5af526895 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -71,7 +71,9 @@ class XmlMaterialProfile(InstanceContainer): material_manager = CuraApplication.getInstance().getMaterialManager() root_material_id = self.getMetaDataEntry("base_file") #if basefile is self.getId, this is a basefile. material_group = material_manager.getMaterialGroup(root_material_id) - + if not material_group: #If the profile is not registered in the registry but loose/temporary, it will not have a base file tree. + super().setMetaDataEntry(key, value) + return # Update the root material container root_material_container = material_group.root_material_node.getContainer() if root_material_container is not None: @@ -1155,6 +1157,8 @@ class XmlMaterialProfile(InstanceContainer): with open(product_to_id_file, encoding = "utf-8") as f: product_to_id_map = json.load(f) product_to_id_map = {key: [value] for key, value in product_to_id_map.items()} + #This also loads "Ultimaker S5" -> "ultimaker_s5" even though that is not strictly necessary with the default to change spaces into underscores. + #However it is not always loaded with that default; this mapping is also used in serialize() without that default. return product_to_id_map ## Parse the value of the "material compatible" property. diff --git a/plugins/XmlMaterialProfile/product_to_id.json b/plugins/XmlMaterialProfile/product_to_id.json index 3e7ce9311f..6b78d3fe64 100644 --- a/plugins/XmlMaterialProfile/product_to_id.json +++ b/plugins/XmlMaterialProfile/product_to_id.json @@ -6,6 +6,7 @@ "Ultimaker 2+": "ultimaker2_plus", "Ultimaker 3": "ultimaker3", "Ultimaker 3 Extended": "ultimaker3_extended", + "Ultimaker S5": "ultimaker_s5", "Ultimaker Original": "ultimaker_original", "Ultimaker Original+": "ultimaker_original_plus", "Ultimaker Original Dual Extrusion": "ultimaker_original_dual", |