diff options
author | Lipu Fei <lipu.fei815@gmail.com> | 2018-06-05 10:02:52 +0300 |
---|---|---|
committer | Lipu Fei <lipu.fei815@gmail.com> | 2018-06-05 10:02:52 +0300 |
commit | 7f7a195627d806a697ec7cf7881653778702aa80 (patch) | |
tree | 7ec6a8cd5dded5f5d130d50cb4187ed88439b367 /plugins/3MFReader/ThreeMFReader.py | |
parent | 02a3067a0ca9b844eeeddc66740afabe10f2c215 (diff) | |
parent | bbd019f9e5917c44dcb3edc032a5a87ce705c827 (diff) |
Fix merge conflicts from 3.4
Diffstat (limited to 'plugins/3MFReader/ThreeMFReader.py')
-rwxr-xr-x | plugins/3MFReader/ThreeMFReader.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py index 5423ee0caa..a3a58b18ba 100755 --- a/plugins/3MFReader/ThreeMFReader.py +++ b/plugins/3MFReader/ThreeMFReader.py @@ -15,6 +15,7 @@ from UM.Math.Vector import Vector from UM.Mesh.MeshBuilder import MeshBuilder from UM.Mesh.MeshReader import MeshReader from UM.Scene.GroupDecorator import GroupDecorator +from UM.MimeTypeDatabase import MimeTypeDatabase, MimeType from cura.Settings.ExtruderManager import ExtruderManager from cura.Scene.CuraSceneNode import CuraSceneNode @@ -25,6 +26,7 @@ from cura.Machines.QualityManager import getMachineDefinitionIDForQualitySearch MYPY = False + try: if not MYPY: import xml.etree.cElementTree as ET @@ -32,10 +34,20 @@ except ImportError: Logger.log("w", "Unable to load cElementTree, switching to slower version") import xml.etree.ElementTree as ET + ## Base implementation for reading 3MF files. Has no support for textures. Only loads meshes! class ThreeMFReader(MeshReader): def __init__(self, application): super().__init__(application) + + MimeTypeDatabase.addMimeType( + MimeType( + name = "application/vnd.ms-package.3dmanufacturing-3dmodel+xml", + comment="3MF", + suffixes=["3mf"] + ) + ) + self._supported_extensions = [".3mf"] self._root = None self._base_name = "" |