RealDocs

UAssetManager::GetRedirectedPrimaryAssetId

function Engine Since 4.22
#include "Engine/AssetManager.h"
Access: public Specifiers: virtualconst

Description

Tries to redirect a Primary Asset Id using the redirector list configured in the project's Asset Manager settings. Returns the original ID unchanged if no redirect applies.

Caveats & Gotchas

  • Redirects are configured under Project Settings > Asset Manager, not derived automatically — renaming a Primary Asset without adding an entry there leaves old saved references broken.
  • This only redirects the ID itself; it does not verify that the new ID still resolves to a valid, registered asset.

Signature

virtual FPrimaryAssetId GetRedirectedPrimaryAssetId(const FPrimaryAssetId& OldId) const

Parameters

Name Type Description Default
OldId const FPrimaryAssetId& Primary asset ID that may have been renamed.

Return Type

FPrimaryAssetId

Example

Resolve a possibly-renamed Primary Asset Id C++
FPrimaryAssetId LoadedId(FPrimaryAssetType("Item"), FName("OldSwordName"));
FPrimaryAssetId CurrentId = UAssetManager::Get().GetRedirectedPrimaryAssetId(LoadedId);

Version History

Introduced in: 4.22

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.