Browse Source

Set version in <fdmmaterial> when saving XML material files

CURA-3884
Lipu Fei 7 years ago
parent
commit
8ede981a2c
1 changed files with 4 additions and 1 deletions
  1. 4 1
      plugins/XmlMaterialProfile/XmlMaterialProfile.py

+ 4 - 1
plugins/XmlMaterialProfile/XmlMaterialProfile.py

@@ -19,6 +19,7 @@ from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
 
 ##  Handles serializing and deserializing material containers from an XML file
 class XmlMaterialProfile(InstanceContainer):
+    CurrentFdmMaterialVersion = "1.3"
     Version = 1
 
     def __init__(self, container_id, *args, **kwargs):
@@ -124,7 +125,9 @@ class XmlMaterialProfile(InstanceContainer):
 
         builder = ET.TreeBuilder()
 
-        root = builder.start("fdmmaterial", { "xmlns": "http://www.ultimaker.com/material"})
+        root = builder.start("fdmmaterial",
+                             {"xmlns": "http://www.ultimaker.com/material",
+                              "version": self.CurrentFdmMaterialVersion})
 
         ## Begin Metadata Block
         builder.start("metadata")