UAssetManager::GetPrimaryAssetLoadSet
#include "Engine/AssetManager.h"
Access: public
Specifiers: const
Description
Fills OutAssetLoadSet with the unique object paths that would need to be loaded for a primary asset under the given bundle list, without actually loading them.
Caveats & Gotchas
- • The header explicitly recommends using GetPrimaryAssetLoadList instead — this overload exists only for backward compatibility and creates an extra TSet allocation.
- • Returns false without modifying OutAssetLoadSet if PrimaryAssetId isn't a recognized primary asset.
Signature
bool GetPrimaryAssetLoadSet(TSet<FSoftObjectPath>& OutAssetLoadSet, const FPrimaryAssetId& PrimaryAssetId, const TArray<FName>& LoadBundles, bool bLoadRecursive) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| OutAssetLoadSet | TSet<FSoftObjectPath>& | Set 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. | — |
Return Type
bool Example
Preview what a load would pull in C++
UAssetManager& Manager = UAssetManager::Get();
TSet<FSoftObjectPath> Paths;
FPrimaryAssetId AssetId(TEXT("Item"), TEXT("Sword"));
if (Manager.GetPrimaryAssetLoadSet(Paths, AssetId, { TEXT("Game") }, /*bLoadRecursive=*/true))
{
UE_LOG(LogTemp, Log, TEXT("Would load %d assets"), Paths.Num());
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?