UAssetManager::GetPrimaryAssetIdForPath
#include "Engine/AssetManager.h"
Access: public
Specifiers: virtualconst
Description
Checks whether the passed-in object path is a registered primary asset and if so returns its id, otherwise returns an invalid FPrimaryAssetId.
Caveats & Gotchas
- • Does not require the asset to be loaded — it matches purely against the registered path directory, making it cheap to call in bulk.
- • Redirected paths may not resolve correctly if the asset registry hasn't processed the redirector yet.
Signature
virtual FPrimaryAssetId GetPrimaryAssetIdForPath(const FSoftObjectPath& ObjectPath) const; Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| ObjectPath | const FSoftObjectPath& | Path to test, e.g. a soft reference stored on another asset. | — |
Return Type
FPrimaryAssetId Example
Resolve a soft reference to an id C++
FSoftObjectPath SomePath(TEXT("/Game/Items/Sword.Sword"));
FPrimaryAssetId Id = UAssetManager::Get().GetPrimaryAssetIdForPath(SomePath); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?