Detected objects loaded in PostLoad while streaming

This appears to be a new warning that started appearing for me when entering PIE (once only, each time after starting editor) after upgrading from 5.0.3 to 5.1.1. This occurs during my project’s loading screen while data is being asynchronously loaded in (via the StreamableManager’s RequestAsyncLoad function).

The warning is being called from line 7024 of AsyncLoading.cpp.

Context:

if (ObjLoadedInPostLoad.Num())
			{
				// If there were any LoadObject calls inside of PostLoad, we need to pre-load those objects here. 
				// There's no going back to the async tick loop from here.
				UE_LOG(LogStreaming, Warning, TEXT("Detected %d objects loaded in PostLoad while streaming, this may cause hitches as we're blocking async loading to pre-load them."), ObjLoadedInPostLoad.Num());

The warning seems to have been added in the following commit: https://github.com/EpicGames/UnrealEngine/commit/298b2383a33130e9786551994cc6e3b544b72e23

The warning is a little tricky to understand, but I think it can probably be understood as indicating that unloaded prerequisites (hard references) to Async loaded objects are being synchronously loaded in during/after each load which can cause hitching. So in order to resolve this, the prerequisites should be async loaded in advance or perhaps in the same async load request? For example, if I am loading an array of UMG Widgets, should I also include all the texture and materials used by them in the RequestAsyncLoad call? Not really sure what the recommended workflow/implementation is.

Given the FSoftObjectPath to an asset, is there an easy way to recursively async load in all referenced assets as well? (or at least find them and add them to an array so they can all be passed in to FStreamableManager::RequestAsyncLoad together?)

4 Likes