UAssetManager::GetPrimaryAssetIdList
#include "Engine/AssetManager.h"
Access: public
Specifiers: virtualconst
Description
Gets the list of all FPrimaryAssetId values registered for a given primary asset type, returning true if any were found.
Caveats & Gotchas
- • This is the most direct way to enumerate every asset of a type by id — prefer it over GetPrimaryAssetDataList when you don't need full FAssetData.
- • The Filter parameter can silently return an empty list even when assets of that type exist, if none match the requested load state.
Signature
virtual bool GetPrimaryAssetIdList(FPrimaryAssetType PrimaryAssetType, TArray<FPrimaryAssetId>& PrimaryAssetIdList, EAssetManagerFilter Filter = EAssetManagerFilter::Default) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PrimaryAssetType | FPrimaryAssetType | Primary asset type to enumerate. | — |
| PrimaryAssetIdList | TArray<FPrimaryAssetId>& | Out array filled with the ids of every registered asset of that type. | — |
| Filter | EAssetManagerFilter | Optional filter to restrict results, e.g. to only unloaded or only loaded assets. | EAssetManagerFilter::Default |
Return Type
bool Example
Enumerate ids of a type C++
TArray<FPrimaryAssetId> ItemIds;
UAssetManager::Get().GetPrimaryAssetIdList(FPrimaryAssetType(TEXT("Item")), ItemIds);
for (const FPrimaryAssetId& Id : ItemIds)
{
UE_LOG(LogTemp, Log, TEXT("Item: %s"), *Id.ToString());
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?