From 0bd516da4c9f2a5e0b81a2ebc1b6419b0a932983 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 30 Apr 2019 11:34:30 +0200 Subject: [PATCH] Add mimetype to amf plugin --- plugins/AMFReader/AMFReader.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/AMFReader/AMFReader.py b/plugins/AMFReader/AMFReader.py index 2132cf6a0e..abc001540e 100644 --- a/plugins/AMFReader/AMFReader.py +++ b/plugins/AMFReader/AMFReader.py @@ -3,7 +3,7 @@ # This AMF parser is based on the AMF parser in legacy cura: # https://github.com/daid/LegacyCura/blob/ad7641e059048c7dcb25da1f47c0a7e95e7f4f7c/Cura/util/meshLoaders/amf.py - +from UM.MimeTypeDatabase import MimeTypeDatabase, MimeType from cura.CuraApplication import CuraApplication from UM.Logger import Logger @@ -30,12 +30,21 @@ except ImportError: from typing import Dict + class AMFReader(MeshReader): def __init__(self) -> None: super().__init__() self._supported_extensions = [".amf"] self._namespaces = {} # type: Dict[str, str] + MimeTypeDatabase.addMimeType( + MimeType( + name="application/x-amf", + comment="AMF", + suffixes=["amf"] + ) + ) + # Main entry point # Reads the file, returns a SceneNode (possibly with nested ones), or None def _read(self, file_name):