diff --git a/UM/Mesh/MeshWriter.py b/UM/Mesh/MeshWriter.py index e9ad3d2798..ccaf4f4503 100644 --- a/UM/Mesh/MeshWriter.py +++ b/UM/Mesh/MeshWriter.py @@ -12,7 +12,7 @@ class MeshWriter(FileWriter): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - def write(self, stream, node, mode = FileWriter.OutputMode.BinaryMode): + def write(self, stream, node, mode = FileWriter.OutputMode.BinaryMode, **kwargs): """Output a collection of nodes to stream in such a way that it makes sense for the file format. @@ -22,6 +22,7 @@ def write(self, stream, node, mode = FileWriter.OutputMode.BinaryMode): :param stream: :type{IOStream} The stream to output to. :param node: A collection of scene nodes to write to the stream. + :param kwargs extra arguments to customize the output (e.g. target mime_type) """ raise NotImplementedError("MeshWriter plugin was not correctly implemented, no write was specified") diff --git a/plugins/FileHandlers/OBJWriter/OBJWriter.py b/plugins/FileHandlers/OBJWriter/OBJWriter.py index b30e7e5a21..f214f3add9 100644 --- a/plugins/FileHandlers/OBJWriter/OBJWriter.py +++ b/plugins/FileHandlers/OBJWriter/OBJWriter.py @@ -11,7 +11,7 @@ catalog = i18nCatalog("uranium") class OBJWriter(MeshWriter): - def write(self, stream, nodes, mode = MeshWriter.OutputMode.TextMode): + def write(self, stream, nodes, mode = MeshWriter.OutputMode.TextMode, **kwargs): """Writes the specified nodes to a stream in the OBJ format. :param stream: The stream to write the OBJ data to. diff --git a/plugins/FileHandlers/STLWriter/STLWriter.py b/plugins/FileHandlers/STLWriter/STLWriter.py index 99112d263b..94f9d4285a 100644 --- a/plugins/FileHandlers/STLWriter/STLWriter.py +++ b/plugins/FileHandlers/STLWriter/STLWriter.py @@ -12,7 +12,7 @@ catalog = i18nCatalog("uranium") class STLWriter(MeshWriter): - def write(self, stream, nodes, mode = MeshWriter.OutputMode.TextMode): + def write(self, stream, nodes, mode = MeshWriter.OutputMode.TextMode, **kwargs): """Write the specified sequence of nodes to a stream in the STL format. :param stream: The output stream to write to. diff --git a/plugins/LocalFileOutputDevice/LocalFileOutputDevice.py b/plugins/LocalFileOutputDevice/LocalFileOutputDevice.py index 55d7d04e71..ae8f028462 100644 --- a/plugins/LocalFileOutputDevice/LocalFileOutputDevice.py +++ b/plugins/LocalFileOutputDevice/LocalFileOutputDevice.py @@ -176,6 +176,8 @@ def _performWrite(self, file_name, selected_type, file_handler, nodes, silent_sa Logger.log("e", "Unrecognised OutputMode.") return None + writer_args["mime_type"] = selected_type["mime_type"] + job = WriteFileJob(file_writer, stream, nodes, mode, writer_args) job.setFileName(file_name) if not silent_save: