UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAssetDataGatherer Class Reference

#include <AssetDataGatherer.h>

+ Inheritance diagram for FAssetDataGatherer:

Public Member Functions

 FAssetDataGatherer (UAssetRegistryImpl &InRegistryImpl)
 
virtual ~FAssetDataGatherer ()
 
void UpdateCacheForSaving ()
 
void OnInitialSearchCompleted ()
 
void OnAdditionalMountSearchCompleted ()
 
void RequestAsyncCacheSave ()
 
void StartAsync ()
 
virtual bool Init () override
 
virtual uint32 Run () override
 
virtual void Stop () override
 
virtual void Exit () override
 
bool IsAsyncEnabled () const
 
bool IsSynchronous () const
 
void EnsureCompletion ()
 
FGatheredResultsEventGetGatheredResultsEvent ()
 
void GetAndTrimSearchResults (UE::AssetDataGather::FResults &InOutResults, UE::AssetDataGather::FResultContext &OutContext)
 
FAssetGatherDiagnostics GetDiagnostics ()
 
void GetPackageResults (UE::AssetDataGather::FResults &InOutResults)
 
void WaitOnPath (FStringView LocalPath)
 
void ClearCache ()
 
void ScanPathsSynchronous (const TArray< FString > &InPaths, bool bForceRescan, bool bIgnoreDenyListScanFilters)
 
void WaitForIdle (float TimeoutSeconds=-1.0f)
 
bool IsComplete () const
 
bool HasSerializedDiscoveryCache () const
 
void SetInitialPluginsLoaded ()
 
bool IsGatheringDependencies () const
 
bool IsCacheReadEnabled () const
 
bool IsCacheWriteEnabled () const
 
SIZE_T GetAllocatedSize () const
 
void AddMountPoint (FStringView LocalPath, FStringView LongPackageName)
 
void RemoveMountPoint (FStringView LocalPath)
 
void AddRequiredMountPoints (TArrayView< FString > LocalPaths)
 
void OnDirectoryCreated (FStringView LocalPath)
 
void OnFilesCreated (TConstArrayView< FString > LocalPaths)
 
void PrioritizeSearchPath (const FString &PathToPrioritize)
 
void SetIsOnAllowList (FStringView LocalPath, bool bIsAllowed)
 
bool IsOnAllowList (FStringView LocalPath) const
 
bool IsOnDenyList (FStringView LocalPath) const
 
bool IsMonitored (FStringView LocalPath) const
 
void PauseProcessing ()
 
void ResumeProcessing ()
 
bool IsProcessingPauseRequested () const
 
void SetGatherOnGameThreadOnly (bool bValue)
 
bool IsGatherOnGameThreadOnly () const
 
void SetIsAdditionalMountSearchInProgress (bool bIsInProgress)
 
- Public Member Functions inherited from FRunnable
virtual class FSingleThreadRunnableGetSingleThreadInterface ()
 
virtual ~FRunnable ()
 

Static Public Member Functions

static bool IsVerseFile (FStringView FilePath)
 
static TConstArrayView< const TCHAR * > GetVerseFileExtensions ()
 
static bool ReadAssetFile (FPackageReader &PackageReader, TArray< FAssetData * > &AssetDataList, FPackageDependencyData &DependencyData, TArray< FString > &CookedPackagesToLoadUponDiscovery, FPackageReader::EReadOptions Options)
 

Detailed Description

Async task for gathering asset data from from the file list in FAssetRegistry

Constructor & Destructor Documentation

◆ FAssetDataGatherer()

FAssetDataGatherer::FAssetDataGatherer ( UAssetRegistryImpl InRegistryImpl)

◆ ~FAssetDataGatherer()

FAssetDataGatherer::~FAssetDataGatherer ( )
virtual

Member Function Documentation

◆ AddMountPoint()

void FAssetDataGatherer::AddMountPoint ( FStringView  LocalPath,
FStringView  LongPackageName 
)

Add a mountpoint to the gatherer after it has been registered with FPackageName .

◆ AddRequiredMountPoints()

void FAssetDataGatherer::AddRequiredMountPoints ( TArrayView< FString >  LocalPaths)

Add MountPoints in LocalPaths to the gatherer.

◆ ClearCache()

void FAssetDataGatherer::ClearCache ( )

Empty the cache read from disk and the cache used to write to disk. Disable further caching. Used to save memory when cooking after the scan is complete.

◆ EnsureCompletion()

void FAssetDataGatherer::EnsureCompletion ( )

Signals to end the thread and waits for it to close before returning

◆ Exit()

void FAssetDataGatherer::Exit ( void  )
overridevirtual

Exits the runnable object.

Called in the context of the aggregating thread to perform any cleanup.

See also
Init, Run, Stop

Reimplemented from FRunnable.

◆ GetAllocatedSize()

SIZE_T FAssetDataGatherer::GetAllocatedSize ( ) const

Return the memory used by the gatherer. Used for performance metrics.

◆ GetAndTrimSearchResults()

void FAssetDataGatherer::GetAndTrimSearchResults ( UE::AssetDataGather::FResults InOutResults,
UE::AssetDataGather::FResultContext OutContext 
)

Gets search results from the data gatherer.

◆ GetDiagnostics()

FAssetGatherDiagnostics FAssetDataGatherer::GetDiagnostics ( )

Get diagnostics for telemetry or logging.

◆ GetGatheredResultsEvent()

FGatheredResultsEvent & FAssetDataGatherer::GetGatheredResultsEvent ( )
inline

Returns reference to delegate invoked when search results have been gathered in GetAndTrimSearchResults.

◆ GetPackageResults()

void FAssetDataGatherer::GetPackageResults ( UE::AssetDataGather::FResults InOutResults)

Gets just the Assets, AssetsForGameThread, Dependencies, and DependenciesForGameThread from the data gatherer.

◆ GetVerseFileExtensions()

TConstArrayView< const TCHAR * > FAssetDataGatherer::GetVerseFileExtensions ( )
static

Return the list of extensions that indicate verse files.

◆ HasSerializedDiscoveryCache()

bool FAssetDataGatherer::HasSerializedDiscoveryCache ( ) const

Returns true if the asset registry has written out the discovery cache after discovery has completed. This function will return false if discovery is not yet complete, discovery caching isn't supported by the current platform or cache writing has been disabled such as when using -NoAssetRegistryCacheWrite.

◆ Init()

bool FAssetDataGatherer::Init ( void  )
overridevirtual

Initializes the runnable object.

This method is called in the context of the thread object that aggregates this, not the thread that passes this runnable to a new thread.

Returns
True if initialization was successful, false otherwise
See also
Run, Stop, Exit

Reimplemented from FRunnable.

◆ IsAsyncEnabled()

bool FAssetDataGatherer::IsAsyncEnabled ( ) const

◆ IsCacheReadEnabled()

bool FAssetDataGatherer::IsCacheReadEnabled ( ) const

Return whether the current process enables reading AssetDataGatherer cache files.

◆ IsCacheWriteEnabled()

bool FAssetDataGatherer::IsCacheWriteEnabled ( ) const

Return whether the current process enables writing AssetDataGatherer cache files.

◆ IsComplete()

bool FAssetDataGatherer::IsComplete ( ) const

Report whether all monitored assets have been added to search results, AND these results have been gathered through a GetAndTrimSearchResults call. This function can be used to check whether there is any work to be done on the gatherer.

◆ IsGatheringDependencies()

bool FAssetDataGatherer::IsGatheringDependencies ( ) const

Report whether the gatherer is configured to load depends data in addition to asset data.

◆ IsGatherOnGameThreadOnly()

bool FAssetDataGatherer::IsGatherOnGameThreadOnly ( ) const
inline

◆ IsMonitored()

bool FAssetDataGatherer::IsMonitored ( FStringView  LocalPath) const

Report whether the path is both in the allow list and not in the deny list.

◆ IsOnAllowList()

bool FAssetDataGatherer::IsOnAllowList ( FStringView  LocalPath) const

Report whether the path is in the allow list. Only paths in AllowList AND not in DenyList will be scanned.

◆ IsOnDenyList()

bool FAssetDataGatherer::IsOnDenyList ( FStringView  LocalPath) const

Report whether the path is in the deny list. Paths in DenyList are not scanned.

◆ IsProcessingPauseRequested()

bool FAssetDataGatherer::IsProcessingPauseRequested ( ) const
inline

◆ IsSynchronous()

bool FAssetDataGatherer::IsSynchronous ( ) const

◆ IsVerseFile()

bool FAssetDataGatherer::IsVerseFile ( FStringView  FilePath)
static

Determine, based on the file extension, if the given file path is a Verse file

◆ OnAdditionalMountSearchCompleted()

void FAssetDataGatherer::OnAdditionalMountSearchCompleted ( )

◆ OnDirectoryCreated()

void FAssetDataGatherer::OnDirectoryCreated ( FStringView  LocalPath)

Called from DirectoryWatcher. Update the directory for reporting in future search results.

◆ OnFilesCreated()

void FAssetDataGatherer::OnFilesCreated ( TConstArrayView< FString >  LocalPaths)

Called from DirectoryWatcher. Update the files for reporting in future search results.

◆ OnInitialSearchCompleted()

void FAssetDataGatherer::OnInitialSearchCompleted ( )

◆ PauseProcessing()

void FAssetDataGatherer::PauseProcessing ( )
inline

Callable by the main thread to request that this thread pause/resume processing data. Gathering can still proceed during this time.

◆ PrioritizeSearchPath()

void FAssetDataGatherer::PrioritizeSearchPath ( const FString &  PathToPrioritize)

Mark a file or directory to be scanned before unprioritized assets.

◆ ReadAssetFile()

bool FAssetDataGatherer::ReadAssetFile ( FPackageReader PackageReader,
TArray< FAssetData * > &  AssetDataList,
FPackageDependencyData DependencyData,
TArray< FString > &  CookedPackagesToLoadUponDiscovery,
FPackageReader::EReadOptions  Options 
)
static

Reads FAssetData information out of a previously initialized package reader

Parameters
PackageReaderthe previously opened package reader
AssetDataListthe FAssetData for every asset found in the file
DependencyDatathe FPackageDependencyData for every asset found in the file
CookedPackagesToLoadUponDiscoverythe list of cooked packages to be loaded if any
OptionsWhich bits of data to read

◆ RemoveMountPoint()

void FAssetDataGatherer::RemoveMountPoint ( FStringView  LocalPath)

Remove a previously added mountpoint.

◆ RequestAsyncCacheSave()

void FAssetDataGatherer::RequestAsyncCacheSave ( )
inline

◆ ResumeProcessing()

void FAssetDataGatherer::ResumeProcessing ( )
inline

◆ Run()

uint32 FAssetDataGatherer::Run ( )
overridevirtual

Runs the runnable object.

This is where all per object thread work is done. This is only called if the initialization was successful.

Returns
The exit code of the runnable object
See also
Init, Stop, Exit

Implements FRunnable.

◆ ScanPathsSynchronous()

void FAssetDataGatherer::ScanPathsSynchronous ( const TArray< FString > &  InPaths,
bool  bForceRescan,
bool  bIgnoreDenyListScanFilters 
)

Add a set of paths to the allow list, optionally force rescanning and ignore deny list on them, and wait for all assets in the paths to be added to search results. Wait time is minimized by prioritizing the paths and transferring async scanning to the current thread.

◆ SetGatherOnGameThreadOnly()

void FAssetDataGatherer::SetGatherOnGameThreadOnly ( bool  bValue)
inline

◆ SetInitialPluginsLoaded()

void FAssetDataGatherer::SetInitialPluginsLoaded ( )

Set after initial plugins have loaded and we should not retry failed loads with missing custom versions.

◆ SetIsAdditionalMountSearchInProgress()

void FAssetDataGatherer::SetIsAdditionalMountSearchInProgress ( bool  bIsInProgress)
inline

◆ SetIsOnAllowList()

void FAssetDataGatherer::SetIsOnAllowList ( FStringView  LocalPath,
bool  bIsAllowed 
)

Mark whether a given path is in the scanning allow list.

By default no paths are scanned; adding a path to the allow list causes it and its subdirectories to be scanned. Note that the deny list (InLongPackageNameDenyList) overrides the allow list. Allow list settings are recursive. Attempting to mark a path as allowed if a parent path is on the allow list will have no effect. This means the scenario ((1) add allow list A (2) add allow list A/Child (3) remove allow list A) will therefore not result in A/Child being allowed.

◆ StartAsync()

void FAssetDataGatherer::StartAsync ( )

Start the async thread, if this Gatherer was created async. Does nothing if not async or already started.

◆ Stop()

void FAssetDataGatherer::Stop ( void  )
overridevirtual

Stops the runnable object.

This is called if a thread is requested to terminate early.

See also
Init, Run, Exit

Reimplemented from FRunnable.

◆ UpdateCacheForSaving()

void FAssetDataGatherer::UpdateCacheForSaving ( )

Update the the Gatherer's cache using in-memory state information before serializing. This method must be called while owning the InterfaceLock.

◆ WaitForIdle()

void FAssetDataGatherer::WaitForIdle ( float  TimeoutSeconds = -1.0f)

Wait for all monitored assets to be added to search results.

◆ WaitOnPath()

void FAssetDataGatherer::WaitOnPath ( FStringView  LocalPath)

Wait for all monitored assets under the given path to be added to search results. Returns immediately if the given path is not monitored.


The documentation for this class was generated from the following files: