RealDocs

UAssetManager::GetPrimaryAssetObjectList

function Engine Since unknown
#include "Engine/AssetManager.h"
Access: public Specifiers: virtualconst

Description

Gets the list of all currently loaded objects for a primary asset type. Returns Blueprint classes for Blueprint assets rather than instances.

Caveats & Gotchas

  • Only assets currently in memory are returned — unloaded assets of the requested type are silently skipped, not reported as an error.
  • Returns true if any were found, so an empty ObjectList with a true return means nothing of that type happens to be loaded right now, not that the type is invalid.

Signature

virtual bool GetPrimaryAssetObjectList(FPrimaryAssetType PrimaryAssetType, TArray<UObject*>& ObjectList) const;

Parameters

Name Type Description Default
PrimaryAssetType FPrimaryAssetType Primary asset type to enumerate.
ObjectList TArray<UObject*>& Out array filled with the currently loaded objects for that type.

Return Type

bool

Example

Iterate loaded assets of a type C++
TArray<UObject*> LoadedItems;
if (UAssetManager::Get().GetPrimaryAssetObjectList(FPrimaryAssetType(TEXT("Item")), LoadedItems))
{
	UE_LOG(LogTemp, Log, TEXT("%d items currently loaded"), LoadedItems.Num());
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.