Hi,
I’d like to create a plugin that takes given assets from content browser and saves their thumbnails as .png files. I was able to create a copy of thumbnails in my own editor window using MakeThumbnailWidget()
function in FAssetThumbnail
class, however I cannot figure out how (or if its even possible) to save its texture into file. I obviously need an array of pixels/colors and I know that I could get them from viewport that displays thumbnails but there is no access to it from FAssetThumbnail
.
There is GetViewportRenderTargetTexture()
which returns FSlateShaderResource
but I’m not sure how/if I can get raw pixels/data from it.
I also digged around and noticed that if had my custom thumbnail renderer maybe I could capture raw data somewhere during the draw process. Although, it seems that thumbnails renderers are connected with a given class so I’m not sure if its a good idea.
Long story short:
How can I save any asset thumbnail as png file?
Any tips appreciated,
Thanks
Edit:
I’ve got it working! Plugin will be ready soon ; )