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

#include <AssetRegistryState.h>

Public Types

using FAssetDataMap = UE::AssetRegistry::Private::FAssetDataMap
 
using FConstAssetDataMap = UE::AssetRegistry::Private::FConstAssetDataMap
 
using EInitializationMode = UE::AssetRegistry::EAppendMode
 
using EEnumerateAssetsFlags = UE::AssetRegistry::EEnumerateAssetsFlags
 

Public Member Functions

 FAssetRegistryState ()
 
 FAssetRegistryState (const FAssetRegistryState &)=delete
 
 FAssetRegistryState (FAssetRegistryState &&Rhs)
 
ASSETREGISTRY_API ~FAssetRegistryState ()
 
FAssetRegistryStateoperator= (const FAssetRegistryState &)=delete
 
ASSETREGISTRY_API FAssetRegistryStateoperator= (FAssetRegistryState &&O)
 
ASSETREGISTRY_API bool HasAssets (const FName PackagePath, bool bARFiltering=false) const
 
ASSETREGISTRY_API bool GetAssets (const FARCompiledFilter &Filter, const TSet< FName > &PackageNamesToSkip, TArray< FAssetData > &OutAssetData, bool bSkipARFilteredAssets=false) const
 
ASSETREGISTRY_API bool EnumerateAssets (const FARCompiledFilter &Filter, const TSet< FName > &PackageNamesToSkip, TFunctionRef< bool(const FAssetData &)> Callback, EEnumerateAssetsFlags InEnumerateFlags=EEnumerateAssetsFlags::AllowUnfilteredArAssets) const
 
ASSETREGISTRY_API bool GetAllAssets (const TSet< FName > &PackageNamesToSkip, TArray< FAssetData > &OutAssetData, bool bARFiltering=false) const
 
ASSETREGISTRY_API void EnumerateAllAssets (TFunctionRef< void(const FAssetData &)> Callback, EEnumerateAssetsFlags InEnumerateFlags=EEnumerateAssetsFlags::AllowAll) const
 
ASSETREGISTRY_API bool EnumerateAllAssets (const TSet< FName > &PackageNamesToSkip, TFunctionRef< bool(const FAssetData &)> Callback, EEnumerateAssetsFlags InEnumerateFlags=EEnumerateAssetsFlags::AllowUnfilteredArAssets) const
 
ASSETREGISTRY_API void EnumerateAllPaths (TFunctionRef< void(FName PathName)> Callback) const
 
ASSETREGISTRY_API void GetPackagesByName (FStringView PackageName, TArray< FName > &OutPackageNames) const
 
ASSETREGISTRY_API FName GetFirstPackageByName (FStringView PackageName) const
 
ASSETREGISTRY_API bool GetDependencies (const FAssetIdentifier &AssetIdentifier, TArray< FAssetIdentifier > &OutDependencies, UE::AssetRegistry::EDependencyCategory Category=UE::AssetRegistry::EDependencyCategory::All, const UE::AssetRegistry::FDependencyQuery &Flags=UE::AssetRegistry::FDependencyQuery()) const
 
ASSETREGISTRY_API bool GetDependencies (const FAssetIdentifier &AssetIdentifier, TArray< FAssetDependency > &OutDependencies, UE::AssetRegistry::EDependencyCategory Category=UE::AssetRegistry::EDependencyCategory::All, const UE::AssetRegistry::FDependencyQuery &Flags=UE::AssetRegistry::FDependencyQuery()) const
 
ASSETREGISTRY_API bool ContainsDependency (const FAssetIdentifier &AssetIdentifier, const FAssetIdentifier &QueryAsset, UE::AssetRegistry::EDependencyCategory Category=UE::AssetRegistry::EDependencyCategory::All, const UE::AssetRegistry::FDependencyQuery &Flags=UE::AssetRegistry::FDependencyQuery()) const
 
ASSETREGISTRY_API bool GetReferencers (const FAssetIdentifier &AssetIdentifier, TArray< FAssetIdentifier > &OutReferencers, UE::AssetRegistry::EDependencyCategory Category=UE::AssetRegistry::EDependencyCategory::All, const UE::AssetRegistry::FDependencyQuery &Flags=UE::AssetRegistry::FDependencyQuery()) const
 
ASSETREGISTRY_API bool GetReferencers (const FAssetIdentifier &AssetIdentifier, TArray< FAssetDependency > &OutReferencers, UE::AssetRegistry::EDependencyCategory Category=UE::AssetRegistry::EDependencyCategory::All, const UE::AssetRegistry::FDependencyQuery &Flags=UE::AssetRegistry::FDependencyQuery()) const
 
const FAssetDataGetAssetByObjectPath (const FSoftObjectPath &ObjectPath) const
 
const FAssetDataGetAssetByObjectPath (const UE::AssetRegistry::Private::FCachedAssetKey &Key) const
 
void EnumerateAssetsByPackageName (const FName PackageName, TFunctionRef< bool(const FAssetData *AssetData)> Callback) const
 
TArray< const FAssetData * > CopyAssetsByPackageName (const FName PackageName) const
 
int32 NumAssetsByPackageName (const FName PackageName) const
 
void EnumerateAssetsByPackagePath (FName LongPackagePathName, TFunctionRef< bool(const FAssetData *AssetData)> Callback) const
 
void EnumerateAssetsByClassPathName (const FTopLevelAssetPath ClassPathName, TFunctionRef< bool(const FAssetData *AssetData)> Callback) const
 
void EnumerateTags (TFunctionRef< bool(FName TagName)> Callback) const
 
bool ContainsTag (FName TagName) const
 
ASSETREGISTRY_API void EnumerateAssetsByTagName (const FName TagName, TFunctionRef< bool(const FAssetData *AssetData)> Callback) const
 
ASSETREGISTRY_API void EnumerateTagToAssetDatas (TFunctionRef< bool(FName TagName, IAssetRegistry::FEnumerateAssetDatasFunc EnumerateAssets)> Callback) const
 
const TMap< FName, const FAssetPackageData * > & GetAssetPackageDataMap () const
 
ASSETREGISTRY_API void GetPrimaryAssetsIds (TSet< FPrimaryAssetId > &OutPrimaryAssets) const
 
ASSETREGISTRY_API const FAssetPackageDataGetAssetPackageData (FName PackageName) const
 
ASSETREGISTRY_API const FAssetPackageDataGetAssetPackageData (FName PackageName, FName &OutCorrectCasePackageName) const
 
ASSETREGISTRY_API FAssetPackageDataGetAssetPackageData (FName PackageName)
 
void GetPackageNames (TArray< FName > &OutPackageNames) const
 
ASSETREGISTRY_API FAssetPackageDataCreateOrGetAssetPackageData (FName PackageName)
 
ASSETREGISTRY_API bool RemovePackageData (FName PackageName)
 
ASSETREGISTRY_API void AddAssetData (FAssetData *AssetData)
 
ASSETREGISTRY_API void AddTagsToAssetData (const FSoftObjectPath &InObjectPath, FAssetDataTagMap &&InTagsAndValues)
 
ASSETREGISTRY_API void UpdateAssetData (const FAssetData &NewAssetData, bool bCreateIfNotExists=false)
 
ASSETREGISTRY_API void UpdateAssetData (FAssetData &&NewAssetData, bool bCreateIfNotExists=false)
 
ASSETREGISTRY_API void UpdateAssetData (FAssetData *AssetData, const FAssetData &NewAssetData, bool *bOutModified=nullptr)
 
ASSETREGISTRY_API void UpdateAssetData (FAssetData *AssetData, FAssetData &&NewAssetData, bool *bOutModified=nullptr)
 
ASSETREGISTRY_API bool UpdateAssetDataPackageFlags (FName PackageName, uint32 PackageFlags)
 
ASSETREGISTRY_API void RemoveAssetData (FAssetData *AssetData, bool bRemoveDependencyData, bool &bOutRemovedAssetData, bool &bOutRemovedPackageData)
 
ASSETREGISTRY_API void RemoveAssetData (const FSoftObjectPath &SoftObjectPath, bool bRemoveDependencyData, bool &bOutRemovedAssetData, bool &bOutRemovedPackageData)
 
ASSETREGISTRY_API void RemoveAssetDatas (TArrayView< FAssetData * > AssetDatas, bool bRemoveDependencyData, TBitArray<> &bOutRemovedAssetData, TBitArray<> &bOutRemovedPackageData)
 
ASSETREGISTRY_API void ClearDependencies (const FAssetIdentifier &AssetIdentifier, UE::AssetRegistry::EDependencyCategory Category)
 
ASSETREGISTRY_API void AddDependencies (const FAssetIdentifier &AssetIdentifier, TConstArrayView< FAssetDependency > Dependencies)
 
ASSETREGISTRY_API void SetDependencies (const FAssetIdentifier &AssetIdentifier, TConstArrayView< FAssetDependency > Dependencies, UE::AssetRegistry::EDependencyCategory Category=UE::AssetRegistry::EDependencyCategory::All)
 
ASSETREGISTRY_API void ClearReferencers (const FAssetIdentifier &AssetIdentifier, UE::AssetRegistry::EDependencyCategory Category)
 
ASSETREGISTRY_API void AddReferencers (const FAssetIdentifier &AssetIdentifier, TConstArrayView< FAssetDependency > Referencers)
 
ASSETREGISTRY_API void SetReferencers (const FAssetIdentifier &AssetIdentifier, TConstArrayView< FAssetDependency > Referencers, UE::AssetRegistry::EDependencyCategory Category=UE::AssetRegistry::EDependencyCategory::All)
 
ASSETREGISTRY_API void Reset ()
 
void InitializeFromExisting (const FAssetRegistryState &Existing, const FAssetRegistrySerializationOptions &Options, EInitializationMode InitializationMode=EInitializationMode::Rebuild, FAssetRegistryAppendResult *OutAppendResult=nullptr)
 
ASSETREGISTRY_API void PruneAssetData (const TSet< FName > &RequiredPackages, const TSet< FName > &RemovePackages, const TSet< int32 > ChunksToKeep, const FAssetRegistrySerializationOptions &Options)
 
ASSETREGISTRY_API void PruneAssetData (const TSet< FName > &RequiredPackages, const TSet< FName > &RemovePackages, const FAssetRegistrySerializationOptions &Options)
 
ASSETREGISTRY_API void Prune (const FAssetRegistryPruneOptions &PruneOptions)
 
ASSETREGISTRY_API void InitializeFromExistingAndPrune (const FAssetRegistryState &ExistingState, const TSet< FName > &RequiredPackages, const TSet< FName > &RemovePackages, const TSet< int32 > ChunksToKeep, const FAssetRegistrySerializationOptions &Options)
 
ASSETREGISTRY_API void FilterTags (const FAssetRegistrySerializationOptions &Options)
 
ASSETREGISTRY_API bool Serialize (FArchive &Ar, const FAssetRegistrySerializationOptions &Options)
 
ASSETREGISTRY_API bool Save (FArchive &Ar, const FAssetRegistrySerializationOptions &Options)
 
ASSETREGISTRY_API bool Load (FArchive &Ar, const FAssetRegistryLoadOptions &Options=FAssetRegistryLoadOptions(), FAssetRegistryVersion::Type *OutVersion=nullptr)
 
ASSETREGISTRY_API SIZE_T GetAllocatedSize (bool bLogDetailed=false) const
 
int32 GetNumAssets () const
 
int32 GetNumPackages () const
 

Static Public Member Functions

static ASSETREGISTRY_API bool LoadFromDisk (const TCHAR *InPath, const FAssetRegistryLoadOptions &InOptions, FAssetRegistryState &OutState, FAssetRegistryVersion::Type *OutVersion=nullptr)
 
static ASSETREGISTRY_API bool IsFilterValid (const FARCompiledFilter &Filter)
 

Friends

class FAssetRegistryGenerator
 
class UAssetRegistryImpl
 
class UE::AssetRegistry::FAssetRegistryImpl
 
class FAssetDataGatherer
 

Detailed Description

The state of an asset registry, this is used internally by IAssetRegistry to represent the disk cache, and is also accessed directly to save/load cooked caches.

Member Typedef Documentation

◆ EEnumerateAssetsFlags

◆ EInitializationMode

◆ FAssetDataMap

◆ FConstAssetDataMap

Constructor & Destructor Documentation

◆ FAssetRegistryState() [1/3]

FAssetRegistryState::FAssetRegistryState ( )
inline

◆ FAssetRegistryState() [2/3]

FAssetRegistryState::FAssetRegistryState ( const FAssetRegistryState )
delete

◆ FAssetRegistryState() [3/3]

FAssetRegistryState::FAssetRegistryState ( FAssetRegistryState &&  Rhs)
inline

◆ ~FAssetRegistryState()

FAssetRegistryState::~FAssetRegistryState ( )

Member Function Documentation

◆ AddAssetData()

void FAssetRegistryState::AddAssetData ( FAssetData AssetData)

Adds the asset data to the lookup maps

◆ AddDependencies()

void FAssetRegistryState::AddDependencies ( const FAssetIdentifier AssetIdentifier,
TConstArrayView< FAssetDependency Dependencies 
)

Add the given dependencies to the given AssetIdentifier (e.g. package). Also adds a referencer link on each of the dependencies.

◆ AddReferencers()

void FAssetRegistryState::AddReferencers ( const FAssetIdentifier AssetIdentifier,
TConstArrayView< FAssetDependency Referencers 
)

Add a dependency on the given AssetIdentifier (e.g. package) from each of the Referencers. Also adds a referencer link to each referencer on the AssetIdentifer's node.

◆ AddTagsToAssetData()

void FAssetRegistryState::AddTagsToAssetData ( const FSoftObjectPath InObjectPath,
FAssetDataTagMap &&  InTagsAndValues 
)

Add the given tags/values to the asset data associated with the given object path, if it exists

◆ ClearDependencies()

void FAssetRegistryState::ClearDependencies ( const FAssetIdentifier AssetIdentifier,
UE::AssetRegistry::EDependencyCategory  Category 
)

Clear all dependencies of the given category from the given AssetIdentifier (e.g. package). Also clears the referencer link from each of the dependencies.

◆ ClearReferencers()

void FAssetRegistryState::ClearReferencers ( const FAssetIdentifier AssetIdentifier,
UE::AssetRegistry::EDependencyCategory  Category 
)

Clear all referencers of the given category from the given AssetIdentifier (e.g. package). Also clears the dependency link from each of the referencers.

◆ ContainsDependency()

bool FAssetRegistryState::ContainsDependency ( const FAssetIdentifier AssetIdentifier,
const FAssetIdentifier QueryAsset,
UE::AssetRegistry::EDependencyCategory  Category = UE::AssetRegistry::EDependencyCategory::All,
const UE::AssetRegistry::FDependencyQuery Flags = UE::AssetRegistry::FDependencyQuery() 
) const

Return whether the supplied package references the query package.

Parameters
PackageNameThe name of the package for which to inspect dependencies (eg, /Game/MyFolder/MyAsset)
QueryAssetWhich package to look for in PackageName's dependencies
CategoryWhich category(ies) of dependencies to look in for QueryAsset. Dependencies matching ANY of the OR'd categories will be considered.
FlagsWhich flags are required present or not present on the dependencies. Dependencies matching ALL required and NONE excluded bits will be considered. For each potentially considered dependency, flags not applicable to their category are ignored.

◆ ContainsTag()

bool FAssetRegistryState::ContainsTag ( FName  TagName) const
inline

Return whether the given TagName occurs in the tags of any asset in the AssetRegistry

◆ CopyAssetsByPackageName()

TArray< const FAssetData * > FAssetRegistryState::CopyAssetsByPackageName ( const FName  PackageName) const
inline

Gets the array of AssetData pointers for the package; does not copy the AssetDatas, just the pointers.

◆ CreateOrGetAssetPackageData()

FAssetPackageData * FAssetRegistryState::CreateOrGetAssetPackageData ( FName  PackageName)

Finds an existing package data, or creates a new one to modify

◆ EnumerateAllAssets() [1/2]

bool FAssetRegistryState::EnumerateAllAssets ( const TSet< FName > &  PackageNamesToSkip,
TFunctionRef< bool(const FAssetData &)>  Callback,
EEnumerateAssetsFlags  InEnumerateFlags = EEnumerateAssetsFlags::AllowUnfilteredArAssets 
) const

Enumerates asset data for all assets in the registry state, except for assets in packages that are in PackageNamesToSkip. Used by the AssetRegistry for scans after an in-memory scan has already been completed.

Parameters
PackageNamesToSkipexplicit list of packages to skip, because they were already added
Callbackfunction to call for each asset data enumerated
InEnumerateFlagsflags to control enumeration and filtering. Note that the default does not include AllowUnmountedPaths; they will be skipped by default.
See also
EEnumerateAssetsFlags.

◆ EnumerateAllAssets() [2/2]

void FAssetRegistryState::EnumerateAllAssets ( TFunctionRef< void(const FAssetData &)>  Callback,
EEnumerateAssetsFlags  InEnumerateFlags = EEnumerateAssetsFlags::AllowAll 
) const

Enumerates asset data for all assets in the registry state.

Parameters
Callbackfunction to call for each asset data enumerated
InEnumerateFlagsflags to control enumeration and filtering. The default includes all AllowFlags and no assets will be skipped by default.
See also
EEnumerateAssetsFlags.

◆ EnumerateAllPaths()

void FAssetRegistryState::EnumerateAllPaths ( TFunctionRef< void(FName PathName)>  Callback) const

Calls the callback with the LongPackageName of each path that has assets as direct children. Callback will not be called for parent paths that have childpaths with direct children but do not have direct children of their own.

◆ EnumerateAssets()

bool FAssetRegistryState::EnumerateAssets ( const FARCompiledFilter Filter,
const TSet< FName > &  PackageNamesToSkip,
TFunctionRef< bool(const FAssetData &)>  Callback,
EEnumerateAssetsFlags  InEnumerateFlags = EEnumerateAssetsFlags::AllowUnfilteredArAssets 
) const

Enumerate asset data for all assets that match the filter. Assets returned must satisfy every filter component if there is at least one element in the component's array. Assets will satisfy a component if they match any of the elements in it.

Parameters
Filterfilter to apply to the assets in the AssetRegistry
PackageNamesToSkipexplicit list of packages to skip, because they were already added
Callbackfunction to call for each asset data enumerated
InEnumerateFlagsflags to control enumeration and filtering. Note that the default does not include AllowUnmountedPaths; they will be skipped by default.
See also
EEnumerateAssetsFlags.

◆ EnumerateAssetsByClassPathName()

void FAssetRegistryState::EnumerateAssetsByClassPathName ( const FTopLevelAssetPath  ClassPathName,
TFunctionRef< bool(const FAssetData *AssetData)>  Callback 
) const
inline

Enumerates the asset datas for the specified asset class

Parameters
ClassPathNamethe class path name of the assets to look for Calls the callback once with each AssetData*, callback is not called if nothing found

◆ EnumerateAssetsByPackageName()

void FAssetRegistryState::EnumerateAssetsByPackageName ( const FName  PackageName,
TFunctionRef< bool(const FAssetData *AssetData)>  Callback 
) const
inline

Enumerates the asset datas for the specified package name

Parameters
PackageNamethe path of the package to be looked up Calls the callback once for each AssetData* in the package; callback is not called if nothing found.

◆ EnumerateAssetsByPackagePath()

void FAssetRegistryState::EnumerateAssetsByPackagePath ( FName  LongPackagePathName,
TFunctionRef< bool(const FAssetData *AssetData)>  Callback 
) const
inline

◆ EnumerateAssetsByTagName()

void FAssetRegistryState::EnumerateAssetsByTagName ( const FName  TagName,
TFunctionRef< bool(const FAssetData *AssetData)>  Callback 
) const

Enumerates the asset datas with the specified asset tag

Parameters
TagNamethe tag name to search for Callst he callback once with each AssetData*, callback is not called if nothing found

◆ EnumerateTags()

void FAssetRegistryState::EnumerateTags ( TFunctionRef< bool(FName TagName)>  Callback) const
inline

Enumerates all tags of any asset in the AssetRegistry

Parameters
Callbackthe function for each tag

◆ EnumerateTagToAssetDatas()

void FAssetRegistryState::EnumerateTagToAssetDatas ( TFunctionRef< bool(FName TagName, IAssetRegistry::FEnumerateAssetDatasFunc EnumerateAssets)>  Callback) const

Enumerates all tags of any asset in the AssetRegistry including function that can be called to enumerate assets for each tag

Parameters
Callbackthe function for each tag pair

◆ FilterTags()

void FAssetRegistryState::FilterTags ( const FAssetRegistrySerializationOptions Options)

Edit every AssetData's Tags to remove Tags that are filtered out by the filtering rules in Options

◆ GetAllAssets()

bool FAssetRegistryState::GetAllAssets ( const TSet< FName > &  PackageNamesToSkip,
TArray< FAssetData > &  OutAssetData,
bool  bARFiltering = false 
) const

Gets asset data for all assets in the registry state.

Parameters
PackageNamesToSkipexplicit list of packages to skip, because they were already added
OutAssetDatathe list of assets
bARFilteringWhether to apply filtering from UE::AssetRegistry::FFiltering (false by default)

◆ GetAllocatedSize()

SIZE_T FAssetRegistryState::GetAllocatedSize ( bool  bLogDetailed = false) const

Returns memory size of entire registry, optionally logging sizes

◆ GetAssetByObjectPath() [1/2]

const FAssetData * FAssetRegistryState::GetAssetByObjectPath ( const FSoftObjectPath ObjectPath) const
inline

Gets the asset data for the specified object path

Parameters
ObjectPaththe path of the object to be looked up
Returns
the assets data, null if not found

◆ GetAssetByObjectPath() [2/2]

const FAssetData * FAssetRegistryState::GetAssetByObjectPath ( const UE::AssetRegistry::Private::FCachedAssetKey Key) const
inline

◆ GetAssetPackageData() [1/3]

FAssetPackageData * FAssetRegistryState::GetAssetPackageData ( FName  PackageName)

◆ GetAssetPackageData() [2/3]

const FAssetPackageData * FAssetRegistryState::GetAssetPackageData ( FName  PackageName) const

Returns pointer to the asset package data

◆ GetAssetPackageData() [3/3]

const FAssetPackageData * FAssetRegistryState::GetAssetPackageData ( FName  PackageName,
FName OutCorrectCasePackageName 
) const

◆ GetAssetPackageDataMap()

const TMap< FName, const FAssetPackageData * > & FAssetRegistryState::GetAssetPackageDataMap ( ) const
inline

Returns const version of internal PackageName->PackageData map for fast iteration

◆ GetAssets()

bool FAssetRegistryState::GetAssets ( const FARCompiledFilter Filter,
const TSet< FName > &  PackageNamesToSkip,
TArray< FAssetData > &  OutAssetData,
bool  bSkipARFilteredAssets = false 
) const

Gets asset data for all assets that match the filter. Assets returned must satisfy every filter component if there is at least one element in the component's array. Assets will satisfy a component if they match any of the elements in it.

Parameters
Filterfilter to apply to the assets in the AssetRegistry
PackageNamesToSkipexplicit list of packages to skip, because they were already added
OutAssetDatathe list of assets in this path
bSkipARFilteredAssetsIf true, skip assets that are skipped by UE::AssetRegistry::FFiltering (false by default)

◆ GetDependencies() [1/2]

bool FAssetRegistryState::GetDependencies ( const FAssetIdentifier AssetIdentifier,
TArray< FAssetDependency > &  OutDependencies,
UE::AssetRegistry::EDependencyCategory  Category = UE::AssetRegistry::EDependencyCategory::All,
const UE::AssetRegistry::FDependencyQuery Flags = UE::AssetRegistry::FDependencyQuery() 
) const

◆ GetDependencies() [2/2]

bool FAssetRegistryState::GetDependencies ( const FAssetIdentifier AssetIdentifier,
TArray< FAssetIdentifier > &  OutDependencies,
UE::AssetRegistry::EDependencyCategory  Category = UE::AssetRegistry::EDependencyCategory::All,
const UE::AssetRegistry::FDependencyQuery Flags = UE::AssetRegistry::FDependencyQuery() 
) const

Appends a list of packages and searchable names that are referenced by the supplied package or name.

Parameters
AssetIdentifierthe name of the package/name for which to gather dependencies
OutDependenciesa list of things that are referenced by AssetIdentifier
Categorywhich category(ies) of dependencies to include in the output list. Dependencies matching ANY of the OR'd categories will be returned.
Flagswhich flags are required present or not present on the dependencies. Dependencies matching ALL required and NONE excluded bits will be returned. For each potentially returned dependency, flags not applicable to their category are ignored.

◆ GetFirstPackageByName()

FName FAssetRegistryState::GetFirstPackageByName ( FStringView  PackageName) const

Returns the first LongPackageName found for the given PackageName. Issues a warning and returns the first (sorted lexically) if there is more than one. Call to check existence of a LongPackageName or find a package with a ShortPackageName.

Parameters
PackageNameName of the package to find, may be a LongPackageName or ShortPackageName.
Returns
The first LongPackageName of the matching package, or NAME_None if not found.

◆ GetNumAssets()

int32 FAssetRegistryState::GetNumAssets ( ) const
inline

Returns the number of assets in this state

◆ GetNumPackages()

int32 FAssetRegistryState::GetNumPackages ( ) const
inline

Returns the number of packages in this state

◆ GetPackageNames()

void FAssetRegistryState::GetPackageNames ( TArray< FName > &  OutPackageNames) const
inline

Returns all package names

◆ GetPackagesByName()

void FAssetRegistryState::GetPackagesByName ( FStringView  PackageName,
TArray< FName > &  OutPackageNames 
) const

Gets the LongPackageNames for all packages with the given PackageName. Call to check existence of a LongPackageName or find all packages with a ShortPackageName.

Parameters
PackageNameName of the package to find, may be a LongPackageName or ShortPackageName.
OutPackageNamesAll discovered matching LongPackageNames are appended to this array.

◆ GetPrimaryAssetsIds()

void FAssetRegistryState::GetPrimaryAssetsIds ( TSet< FPrimaryAssetId > &  OutPrimaryAssets) const

Get the set of primary assets contained in this state

◆ GetReferencers() [1/2]

bool FAssetRegistryState::GetReferencers ( const FAssetIdentifier AssetIdentifier,
TArray< FAssetDependency > &  OutReferencers,
UE::AssetRegistry::EDependencyCategory  Category = UE::AssetRegistry::EDependencyCategory::All,
const UE::AssetRegistry::FDependencyQuery Flags = UE::AssetRegistry::FDependencyQuery() 
) const

◆ GetReferencers() [2/2]

bool FAssetRegistryState::GetReferencers ( const FAssetIdentifier AssetIdentifier,
TArray< FAssetIdentifier > &  OutReferencers,
UE::AssetRegistry::EDependencyCategory  Category = UE::AssetRegistry::EDependencyCategory::All,
const UE::AssetRegistry::FDependencyQuery Flags = UE::AssetRegistry::FDependencyQuery() 
) const

Appends a list of packages and searchable names that reference the supplied package or name.

Parameters
AssetIdentifierthe name of the package/name for which to gather dependencies
OutReferencersa list of things that reference AssetIdentifier
Categorywhich category(ies) of dependencies to include in the output list. Dependencies matching ANY of the OR'd categories will be returned.
Flagswhich flags are required present or not present on the dependencies. Dependencies matching ALL required and NONE excluded bits will be returned. For each potentially returned dependency, flags not applicable to their category are ignored.

◆ HasAssets()

bool FAssetRegistryState::HasAssets ( const FName  PackagePath,
bool  bARFiltering = false 
) const

Does the given path contain assets?

Parameters
bARFilteringWhether to apply filtering from UE::AssetRegistry::FFiltering (false by default)
Note
This function doesn't recurse into sub-paths.

◆ InitializeFromExisting()

void FAssetRegistryState::InitializeFromExisting ( const FAssetRegistryState Existing,
const FAssetRegistrySerializationOptions Options,
EInitializationMode  InitializationMode = EInitializationMode::Rebuild,
FAssetRegistryAppendResult OutAppendResult = nullptr 
)
inline

◆ InitializeFromExistingAndPrune()

void FAssetRegistryState::InitializeFromExistingAndPrune ( const FAssetRegistryState ExistingState,
const TSet< FName > &  RequiredPackages,
const TSet< FName > &  RemovePackages,
const TSet< int32 ChunksToKeep,
const FAssetRegistrySerializationOptions Options 
)

Initializes a cache from an existing using a set of filters. This is more efficient than calling InitalizeFromExisting and then PruneAssetData.

Parameters
ExistingStateState to use initialize from
RequiredPackagesIf set, only these packages will be maintained. If empty it will keep all unless filtered by other parameters.
RemovePackagesThese packages will be removed from the current set
ChunksToKeepThe list of chunks that are allowed to remain. Any assets in other chunks are pruned. If empty, all assets are kept regardless of chunk
OptionsSerialization options to read filter info from

◆ IsFilterValid()

bool FAssetRegistryState::IsFilterValid ( const FARCompiledFilter Filter)
static

Checks a filter to make sure there are no illegal entries

◆ Load()

bool FAssetRegistryState::Load ( FArchive Ar,
const FAssetRegistryLoadOptions Options = FAssetRegistryLoadOptions(),
FAssetRegistryVersion::Type OutVersion = nullptr 
)

◆ LoadFromDisk()

bool FAssetRegistryState::LoadFromDisk ( const TCHAR InPath,
const FAssetRegistryLoadOptions InOptions,
FAssetRegistryState OutState,
FAssetRegistryVersion::Type OutVersion = nullptr 
)
static

Example Usage: FAssetRegistryState AR; bool bSucceeded = FAssetRegistryState::LoadFromDisk(TEXT("Path/To/AR"), FAssetRegistryLoadOptions(), AR);

◆ NumAssetsByPackageName()

int32 FAssetRegistryState::NumAssetsByPackageName ( const FName  PackageName) const
inline

◆ operator=() [1/2]

FAssetRegistryState & FAssetRegistryState::operator= ( const FAssetRegistryState )
delete

◆ operator=() [2/2]

FAssetRegistryState & FAssetRegistryState::operator= ( FAssetRegistryState &&  O)

◆ Prune()

void FAssetRegistryState::Prune ( const FAssetRegistryPruneOptions PruneOptions)

◆ PruneAssetData() [1/2]

void FAssetRegistryState::PruneAssetData ( const TSet< FName > &  RequiredPackages,
const TSet< FName > &  RemovePackages,
const FAssetRegistrySerializationOptions Options 
)

◆ PruneAssetData() [2/2]

void FAssetRegistryState::PruneAssetData ( const TSet< FName > &  RequiredPackages,
const TSet< FName > &  RemovePackages,
const TSet< int32 ChunksToKeep,
const FAssetRegistrySerializationOptions Options 
)

Prunes an asset cache, this removes asset data, nodes, and package data that isn't needed.

Parameters
RequiredPackagesIf set, only these packages will be maintained. If empty it will keep all unless filtered by other parameters
RemovePackagesThese packages will be removed from the current set
ChunksToKeepThe list of chunks that are allowed to remain. Any assets in other chunks are pruned. If empty, all assets are kept regardless of chunk
OptionsSerialization options to read filter info from

◆ RemoveAssetData() [1/2]

void FAssetRegistryState::RemoveAssetData ( const FSoftObjectPath SoftObjectPath,
bool  bRemoveDependencyData,
bool bOutRemovedAssetData,
bool bOutRemovedPackageData 
)

◆ RemoveAssetData() [2/2]

void FAssetRegistryState::RemoveAssetData ( FAssetData AssetData,
bool  bRemoveDependencyData,
bool bOutRemovedAssetData,
bool bOutRemovedPackageData 
)

Removes the asset data from the lookup maps

◆ RemoveAssetDatas()

void FAssetRegistryState::RemoveAssetDatas ( TArrayView< FAssetData * >  AssetDatas,
bool  bRemoveDependencyData,
TBitArray<> &  bOutRemovedAssetData,
TBitArray<> &  bOutRemovedPackageData 
)

Removes a set of asset data from the lookup maps.

◆ RemovePackageData()

bool FAssetRegistryState::RemovePackageData ( FName  PackageName)

Removes existing package data

◆ Reset()

void FAssetRegistryState::Reset ( )

Resets to default state

◆ Save()

bool FAssetRegistryState::Save ( FArchive Ar,
const FAssetRegistrySerializationOptions Options 
)

Save without editor-only data

◆ Serialize()

bool FAssetRegistryState::Serialize ( FArchive Ar,
const FAssetRegistrySerializationOptions Options 
)

Serialize the registry to/from a file, skipping editor only data

◆ SetDependencies()

void FAssetRegistryState::SetDependencies ( const FAssetIdentifier AssetIdentifier,
TConstArrayView< FAssetDependency Dependencies,
UE::AssetRegistry::EDependencyCategory  Category = UE::AssetRegistry::EDependencyCategory::All 
)

Clears existing dependencies of the given Category(s) and assigns the input Dependencies. Gives an error if any elements of Dependencies are outside of the Category(s).

◆ SetReferencers()

void FAssetRegistryState::SetReferencers ( const FAssetIdentifier AssetIdentifier,
TConstArrayView< FAssetDependency Referencers,
UE::AssetRegistry::EDependencyCategory  Category = UE::AssetRegistry::EDependencyCategory::All 
)

Clears existing referencers of the given Category(s) and assigns the input Referencers. Gives an error if any elements of Referencers are outside of the Category(s).

◆ UpdateAssetData() [1/4]

void FAssetRegistryState::UpdateAssetData ( const FAssetData NewAssetData,
bool  bCreateIfNotExists = false 
)

Finds an existing asset data based on object path and updates it with the new value and updates lookup maps

◆ UpdateAssetData() [2/4]

void FAssetRegistryState::UpdateAssetData ( FAssetData &&  NewAssetData,
bool  bCreateIfNotExists = false 
)

◆ UpdateAssetData() [3/4]

void FAssetRegistryState::UpdateAssetData ( FAssetData AssetData,
const FAssetData NewAssetData,
bool bOutModified = nullptr 
)

Updates an existing asset data with the new value and updates lookup maps

◆ UpdateAssetData() [4/4]

void FAssetRegistryState::UpdateAssetData ( FAssetData AssetData,
FAssetData &&  NewAssetData,
bool bOutModified = nullptr 
)

◆ UpdateAssetDataPackageFlags()

bool FAssetRegistryState::UpdateAssetDataPackageFlags ( FName  PackageName,
uint32  PackageFlags 
)

Updates all asset data package flags in the specified package

Parameters
PackageNamethe package name
PackageFlagsthe package flags to set
Returns
True if any assets exists in the package

Friends And Related Symbol Documentation

◆ FAssetDataGatherer

friend class FAssetDataGatherer
friend

◆ FAssetRegistryGenerator

friend class FAssetRegistryGenerator
friend

◆ UAssetRegistryImpl

friend class UAssetRegistryImpl
friend

◆ UE::AssetRegistry::FAssetRegistryImpl


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