RealDocs

UAssetManager::GetPrimaryAssetBundleStateMap

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

Description

Fills BundleStateMap with a full snapshot of every loaded primary asset mapped to its active bundle list, in a single call.

Caveats & Gotchas

  • The map contents reflect pending bundle state by default; pass bForceCurrent = true if you need to know only what has actually finished loading.
  • This rebuilds the map from scratch each call, which can be relatively expensive if the asset manager is tracking a large number of loaded primary assets — don't call it every frame.

Signature

void GetPrimaryAssetBundleStateMap(TMap<FPrimaryAssetId, TArray<FName>>& BundleStateMap, bool bForceCurrent = false) const;

Parameters

Name Type Description Default
BundleStateMap TMap<FPrimaryAssetId, TArray<FName>>& Out map filled with every loaded primary asset and its currently active bundle list.
bForceCurrent bool If true, reports only the completed current state instead of the pending state. false

Return Type

void

Example

Dump the current bundle state for debugging C++
UAssetManager& Manager = UAssetManager::Get();
TMap<FPrimaryAssetId, TArray<FName>> BundleMap;
Manager.GetPrimaryAssetBundleStateMap(BundleMap, /*bForceCurrent=*/true);
for (const auto& Pair : BundleMap)
{
	UE_LOG(LogTemp, Log, TEXT("%s: %d bundles"), *Pair.Key.ToString(), Pair.Value.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.