RealDocs

UAssetManager::GetPreviousPrimaryAssetIds

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

Description

Reads the redirector list and returns every previous Primary Asset Id that now redirects to NewId. This is the reverse lookup of GetRedirectedPrimaryAssetId.

Caveats & Gotchas

  • Useful for migration tooling that needs to find and fix up old save data referencing renamed assets, since it enumerates all known former names rather than just checking one.
  • OutOldIds is not cleared automatically in every code path — pass in an empty array to avoid mixing results from a previous call.

Signature

virtual void GetPreviousPrimaryAssetIds(const FPrimaryAssetId& NewId, TArray<FPrimaryAssetId>& OutOldIds) const

Parameters

Name Type Description Default
NewId const FPrimaryAssetId& Current Primary Asset Id to look up prior names for.
OutOldIds TArray<FPrimaryAssetId>& Filled with every previous ID that redirects to NewId.

Return Type

void

Example

Find all former IDs for a renamed asset C++
FPrimaryAssetId CurrentId(FPrimaryAssetType("Item"), FName("Sword"));
TArray<FPrimaryAssetId> OldIds;
UAssetManager::Get().GetPreviousPrimaryAssetIds(CurrentId, OldIds);

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.