mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
[CURA-5775] The snaphot-creation of the UFP-writer should only be called when writing to UFP-files.
This commit is contained in:
parent
436860f841
commit
110d2daa81
1 changed files with 3 additions and 2 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue