From 110d2daa81e6e28cbfe420974cbeefb4c561e921 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Thu, 4 Oct 2018 15:54:22 +0200 Subject: [PATCH] [CURA-5775] The snaphot-creation of the UFP-writer should only be called when writing to UFP-files. --- plugins/UFPWriter/UFPWriter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/UFPWriter/UFPWriter.py b/plugins/UFPWriter/UFPWriter.py index d318a0e77d..b3088fc863 100644 --- a/plugins/UFPWriter/UFPWriter.py +++ b/plugins/UFPWriter/UFPWriter.py @@ -27,14 +27,13 @@ class UFPWriter(MeshWriter): MimeTypeDatabase.addMimeType( MimeType( - name = "application/x-cura-stl-file", + name = "application/x-ufp", comment = "Cura UFP File", suffixes = ["ufp"] ) ) self._snapshot = None - Application.getInstance().getOutputDeviceManager().writeStarted.connect(self._createSnapshot) def _createSnapshot(self, *args): # must be called from the main thread because of OpenGL @@ -62,6 +61,8 @@ class UFPWriter(MeshWriter): gcode.write(gcode_textio.getvalue().encode("UTF-8")) archive.addRelation(virtual_path = "/3D/model.gcode", relation_type = "http://schemas.ultimaker.org/package/2018/relationships/gcode") + self._createSnapshot() + #Store the thumbnail. if self._snapshot: archive.addContentType(extension = "png", mime_type = "image/png")