diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 7a88618a7e..eed9d56741 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -257,7 +257,7 @@ class CuraEngineBackend(QObject, Backend): Logger.logException("w", "Failed to create snapshot image") self._snapshot = None # Failing to create thumbnail should not fail creation of UFP - def getLatestSnapShot(self) -> Optional[QImage]: + def getLatestSnapshot(self) -> Optional[QImage]: return self._snapshot def slice(self) -> None: diff --git a/plugins/UFPWriter/UFPWriter.py b/plugins/UFPWriter/UFPWriter.py index b7941c425f..fe4d39059c 100644 --- a/plugins/UFPWriter/UFPWriter.py +++ b/plugins/UFPWriter/UFPWriter.py @@ -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")