Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion UM/Mesh/MeshWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion plugins/FileHandlers/OBJWriter/OBJWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion plugins/FileHandlers/STLWriter/STLWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions plugins/LocalFileOutputDevice/LocalFileOutputDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading