This is going to be a short one.
Sometimes you’ll want to add an asset’s thumbnail to a tool. It’s actually pretty simple! There are only four parts to the whole thing.
In your widget’s .h file, declare a ThumbnailPool…
|
|
And then create it in the .cpp file like this:
|
|
Then to actually create your thumbnail, you need to grab the FAssetData for the asset, usually through the AssetRegistryModule:
|
|
There is a lot you can config about your thumbnails as well, using FAssetThumbnailConfig.
Then to actually create the thumbnail widget and add it to your widget, just call MakeThumbnailWidget
.
|
|
And that’s it! Go forth!