RealDocs

UAssetManager::GetAssetPathForData

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

Description

Converts an FAssetData into an FSoftObjectPath, appending the _C suffix automatically when the asset is a Blueprint class.

Caveats & Gotchas

  • This is the inverse operation of GetAssetDataForPath, and the two should be used as a matched pair rather than constructing soft paths manually with string concatenation.
  • For non-Blueprint assets the returned path is just the object path already present in AssetData; the _C handling only matters for Blueprint generated classes.

Signature

virtual FSoftObjectPath GetAssetPathForData(const FAssetData& AssetData) const

Parameters

Name Type Description Default
AssetData const FAssetData& Asset registry entry to convert.

Return Type

FSoftObjectPath

Example

Convert asset data to a soft path C++
FSoftObjectPath Path = UAssetManager::Get().GetAssetPathForData(AssetData);
UE_LOG(LogTemp, Log, TEXT("Resolved path: %s"), *Path.ToString());

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.