Download

Bug (assert) while generating asset thumbnails

Hi,

I found a bug in AssetThumbnail.cpp.

To repro, you need an asset that will fail to import.

  • On editor start-up, when it does the assets in the folders, before the asset discovery finishes, click import
  • Choose to import an asset that will fail to import.
  • You will get the message ‘Failed to import asset Blah… etc.’
  • The editor will then try and complete the asset discovery and generate the thumbnails for all discovered assets.

At this point, the asset that failed to import will still be among the ones in FAssetThumbnailPool and the latter will try to generate a thumbnail for it, even if the asset is marked as PendingKill.
It is important the asset discovery is still in progress when the asset fails to re-import, otherwise everything works as expected (i.e. the failing asset never ends-up in the thumbnail generation list).

Do you happen to have the callstack? It sounds like we should just avoid attempting to render objects that are marked as PendingKill.

It crashes in FAssetThumbnailPool::Tick( float DeltaTime ) RenderThumbnail as far as I can remember. My temporary fix was to add a && !Asset->IsPendingKill() to if ( RenderInfo != NULL && RenderInfo->Renderer != NULL && !Asset->IsPendingKill() ) in the Tick function, but that’s not right, as I end-up with an empty thumbnail for the asset that failed to import :). I can live with that for the moment but thought you might have a better fix.

Ah yes, well objects like that should not even show up in the content browser in the first place. What kind of asset did you fail to import? Was it a skeletal mesh from an FBX file?

No, my own custom asset type.