RealDocs

UAssetManager::GetPrimaryAssetIdForData

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

Description

Returns the primary asset id for the given FAssetData, only working if that asset is already present in the asset directory.

Caveats & Gotchas

  • Cheaper than GetPrimaryAssetIdForObject when you already have FAssetData from an asset registry query, since it avoids loading the object.
  • Returns an invalid id for assets outside the scanned primary asset directories, even if the FAssetData itself is valid.

Signature

virtual FPrimaryAssetId GetPrimaryAssetIdForData(const FAssetData& AssetData) const;

Parameters

Name Type Description Default
AssetData const FAssetData& Asset registry data to derive a primary asset id from.

Return Type

FPrimaryAssetId

Example

Derive id from a registry query result C++
FAssetData AssetData; // obtained from an IAssetRegistry query
FPrimaryAssetId Id = UAssetManager::Get().GetPrimaryAssetIdForData(AssetData);

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.