diff options
author | Jaime van Kessel <nallath@gmail.com> | 2016-11-30 16:15:19 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2016-11-30 16:15:19 +0300 |
commit | e941d417f1fd570ed836d05b5816cf3e588e94b5 (patch) | |
tree | f60298cb85e5f2121fb165bb401c70e0379c7b0f /plugins/3MFWriter/ThreeMFWriter.py | |
parent | d08c1b73bf0f8824a996e310481a08f03d45ecae (diff) |
Added CuraVersion to 3mf metadata
Diffstat (limited to 'plugins/3MFWriter/ThreeMFWriter.py')
-rw-r--r-- | plugins/3MFWriter/ThreeMFWriter.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/3MFWriter/ThreeMFWriter.py b/plugins/3MFWriter/ThreeMFWriter.py index d86b119276..882740c4ed 100644 --- a/plugins/3MFWriter/ThreeMFWriter.py +++ b/plugins/3MFWriter/ThreeMFWriter.py @@ -5,7 +5,7 @@ from UM.Mesh.MeshWriter import MeshWriter from UM.Math.Vector import Vector from UM.Logger import Logger from UM.Math.Matrix import Matrix -from UM.Settings.SettingRelation import RelationType +from UM.Application import Application try: import xml.etree.cElementTree as ET @@ -78,6 +78,12 @@ class ThreeMFWriter(MeshWriter): model_relation_element = ET.SubElement(relations_element, "Relationship", Target = "/3D/3dmodel.model", Id = "rel0", Type = "http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel") model = ET.Element("model", unit = "millimeter", xmlns = self._namespaces["3mf"]) + + # Add the version of Cura this was created with. As "CuraVersion" is not a recognised metadata name + # by 3mf itself, we place it in our own namespace. + version_metadata = ET.SubElement(model, "metadata", xmlns = self._namespaces["cura"], name = "CuraVersion") + version_metadata.text = Application.getInstance().getVersion() + resources = ET.SubElement(model, "resources") build = ET.SubElement(model, "build") |