RealDocs

UAssetManager::SearchAssetRegistryPaths

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

Description

Helper that searches the asset registry for AssetData matching the given FAssetManagerSearchRules, combining directory scope, wildcard patterns, and base class filtering. Returns the number of matches found.

Caveats & Gotchas

  • Rules.AssetScanPaths directories must already have been scanned by the asset registry (via ScanPathsSynchronous or a prior full scan) or matching assets simply won't be found, with no error raised.
  • Rules.bHasBlueprintClasses must be set correctly to match Blueprint assets — it changes how the base class filter is applied against the ParentClass tag rather than the asset's own class.

Signature

virtual int32 SearchAssetRegistryPaths(TArray<FAssetData>& OutAssetDataList, const FAssetManagerSearchRules& Rules) const

Parameters

Name Type Description Default
OutAssetDataList TArray<FAssetData>& Filled with every asset matching Rules.
Rules const FAssetManagerSearchRules& Search paths, include/exclude wildcard patterns, and base class filter to apply.

Return Type

int32

Example

Search for all item Blueprints under a folder C++
FAssetManagerSearchRules Rules;
Rules.AssetScanPaths.Add(TEXT("/Game/Items"));
Rules.AssetBaseClass = AItem::StaticClass();
Rules.bHasBlueprintClasses = true;

TArray<FAssetData> Results;
int32 NumFound = UAssetManager::Get().SearchAssetRegistryPaths(Results, Rules);

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.