UAssetManager::ScanPathsForPrimaryAssets

Scans a list of paths and reads asset data for all primary assets of a specific type.

Choose your operating system:

Windows

macOS

Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/AssetManager.h

Include

#include "Engine/AssetManager.h"

Source

/Engine/Source/Runtime/Engine/Private/AssetManager.cpp

Syntax

virtual int32 ScanPathsForPrimaryAssets
(
    FPrimaryAssetType PrimaryAssetType,
    const TArray< FString > & Paths,
    UClass * BaseClass,
    bool bHasBlueprintClasses,
    bool bIsEditorOnly,
    bool bForceSynchronousScan
)

Remarks

Scans a list of paths and reads asset data for all primary assets of a specific type. If done in the editor it will load the data off disk, in cooked games it will load out of the asset registry cache

Returns

Number of primary assets found

Parameters

Parameter

Description

PrimaryAssetType

Type of asset to look for. If the scanned asset matches GetPrimaryAssetType with this it will be added to directory

Paths

List of file system paths to scan

BaseClass

Base class of all loaded assets, if the scanned asset isn't a child of this class it will be skipped

bHasBlueprintClasses

If true, the assets are blueprints that subclass BaseClass. If false they are base UObject assets

bIsEditorOnly

If true, assets will only be scanned in editor builds, and will not be stored into the asset registry

bForceSynchronousScan

If true will scan the disk synchronously, otherwise will wait for asset registry scan to complete