RealDocs

UAssetManager::ExtractSoftObjectPaths

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

Description

Walks a class or struct's reflected properties and extracts every FSoftObjectPath found, including those nested inside arrays, maps, and sub-structs.

Caveats & Gotchas

  • This uses reflection and recurses into nested UStruct properties, so it can be relatively slow on large data assets — avoid calling it every frame.
  • PropertiesToSkip matches by property FName only, not by full path, so a name shared across nested structs will be skipped everywhere it appears.
  • Used internally by the asset registry's dependency scanning for data assets that expose soft references outside of normal cook dependency detection.

Signature

virtual void ExtractSoftObjectPaths(const UStruct* Struct, const void* StructValue, TArray<FSoftObjectPath>& FoundAssetReferences, const TArray<FName>& PropertiesToSkip = TArray<FName>()) const

Parameters

Name Type Description Default
Struct const UStruct* UClass or UScriptStruct describing the layout of StructValue.
StructValue const void* Pointer to the actual instance data to scan.
FoundAssetReferences TArray<FSoftObjectPath>& Filled with every soft object path found within the struct.
PropertiesToSkip const TArray<FName>& Property names to exclude from the scan. TArray<FName>()

Return Type

void

Example

Extract soft references from a data asset instance C++
TArray<FSoftObjectPath> FoundPaths;
UAssetManager::Get().ExtractSoftObjectPaths(MyDataAsset->GetClass(), MyDataAsset, FoundPaths);

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.