RealDocs

UAssetManager::ScanPathForPrimaryAssets

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

Description

Single-path convenience wrapper around ScanPathsForPrimaryAssets.

Caveats & Gotchas

  • Internally just wraps Path in a single-element TArray and forwards to ScanPathsForPrimaryAssets — prefer the plural overload directly if you're scanning more than one path.
  • Same asset registry cache caveat as ScanPathsForPrimaryAssets applies in cooked builds.

Signature

virtual int32 ScanPathForPrimaryAssets(FPrimaryAssetType PrimaryAssetType, const FString& Path, UClass* BaseClass, bool bHasBlueprintClasses, bool bIsEditorOnly = false, bool bForceSynchronousScan = true);

Parameters

Name Type Description Default
PrimaryAssetType FPrimaryAssetType Type to assign to any matching assets found.
Path const FString& Single file system path to scan.
BaseClass UClass* Base class assets must derive from to be included; others are skipped.
bHasBlueprintClasses bool True if the scanned assets are Blueprints subclassing BaseClass rather than base UObject assets.
bIsEditorOnly bool If true, only scans in editor builds and does not persist into the asset registry. false
bForceSynchronousScan bool If true, scans the disk synchronously; otherwise waits for the asset registry scan to complete. true

Return Type

int32

Example

Scanning a single folder C++
int32 NumFound = UAssetManager::Get().ScanPathForPrimaryAssets(
	FPrimaryAssetType("Item"),
	TEXT("/Game/Items"),
	UItemDefinition::StaticClass(),
	/*bHasBlueprintClasses=*/ false);

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.