UAssetManager::GetPrimaryAssetLoadList
#include "Engine/AssetManager.h"
Access: public
Specifiers: const
Description
Fills OutAssetLoadList with the object paths that would need to be loaded for a primary asset under the given bundle list, without loading them. This is the preferred replacement for GetPrimaryAssetLoadSet.
Caveats & Gotchas
- • With bLoadRecursive true, the result can expand well beyond the immediate bundle list because sub-bundles referenced by other primary assets get pulled in too.
- • Setting bEnsureUniqueness to false skips the dedup pass for a small performance gain, but you must then handle duplicate paths yourself if you feed the list into a load call.
Signature
bool GetPrimaryAssetLoadList(TArray<FSoftObjectPath>& OutAssetLoadList, const FPrimaryAssetId& PrimaryAssetId, const TArray<FName>& LoadBundles, bool bLoadRecursive, bool bEnsureUniqueness = true) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| OutAssetLoadList | TArray<FSoftObjectPath>& | Array that asset paths needing load are added to. | — |
| PrimaryAssetId | const FPrimaryAssetId& | Asset that would be loaded. | — |
| LoadBundles | const TArray<FName>& | List of bundles to consider loading for the asset. | — |
| bLoadRecursive | bool | If true, recurses into sub-bundles referenced by other primary assets via RecursivelyExpandBundleData. | — |
| bEnsureUniqueness | bool | If true, only unique paths are inserted into OutAssetLoadList. | true |
Return Type
bool Example
Preview and then load the same set of assets C++
UAssetManager& Manager = UAssetManager::Get();
TArray<FSoftObjectPath> Paths;
FPrimaryAssetId AssetId(TEXT("Item"), TEXT("Sword"));
if (Manager.GetPrimaryAssetLoadList(Paths, AssetId, { TEXT("Game") }, /*bLoadRecursive=*/true))
{
Manager.LoadAssetList(Paths);
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?