mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Properly retrieve snapshot (now made on slice).
Circumvents the snapshot/thumbnail not working when the focus is not on the main window, even if the thread is main. This was an issue when writing a file to Digital Factory becasue that workflow uses a modal window. Thanks for the idea Jelle!
This commit is contained in:
parent
4fc0612806
commit
f4ef3b44e3
2 changed files with 3 additions and 6 deletions
|
@ -62,12 +62,9 @@ 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")
|
||||
|
||||
snapshot = None
|
||||
# Attempt to store the thumbnail, if any:
|
||||
backend = CuraApplication.getInstance().getBackend()
|
||||
if isinstance(backend, CuraEngineBackend):
|
||||
snapshot = backend.getLatestSnapshot()
|
||||
|
||||
# Store the thumbnail.
|
||||
snapshot = None if getattr(backend, "getLatestSnapshot", None) is None else backend.getLatestSnapshot()
|
||||
if snapshot:
|
||||
archive.addContentType(extension = "png", mime_type = "image/png")
|
||||
thumbnail = archive.getStream("/Metadata/thumbnail.png")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue