Navigation
API > API/Runtime > API/Runtime/AssetRegistry
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.
| Name | FAssetRegistryState |
| Type | class |
| Header File | /Engine/Source/Runtime/AssetRegistry/Public/AssetRegistry/AssetRegistryState.h |
| Include Path | #include "AssetRegistry/AssetRegistryState.h" |
Syntax
class FAssetRegistryState
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FAssetRegistryState
(
FAssetRegistryState&& Rhs |
AssetRegistry/AssetRegistryState.h | ||
| AssetRegistry/AssetRegistryState.h | |||
FAssetRegistryState
(
const FAssetRegistryState& |
AssetRegistry/AssetRegistryState.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FAssetRegistryState() |
AssetRegistry/AssetRegistryState.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| EEnumerateAssetsFlags | UE::AssetRegistry::EEnumerateAssetsFlags | AssetRegistry/AssetRegistryState.h | |
| EInitializationMode | UE::AssetRegistry::EAppendMode | AssetRegistry/AssetRegistryState.h | |
| FAssetDataMap | UE::AssetRegistry::Private::FAssetDataMap | These types are an implementation detail and they and the functions which take/return them are subject to change without deprecation warnings. | AssetRegistry/AssetRegistryState.h |
| FCachedAssetKey | UE::AssetRegistry::Private::FCachedAssetKey | AssetRegistry/AssetRegistryState.h | |
| FConstAssetDataMap | UE::AssetRegistry::Private::FConstAssetDataMap | AssetRegistry/AssetRegistryState.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bCookedGlobalAssetRegistryState | bool | True if this asset registry state was loaded from a cooked asset registry | AssetRegistry/AssetRegistryState.h | |
| CachedAssets | FAssetDataMap | Set of asset data for assets saved to disk. | AssetRegistry/AssetRegistryState.h | |
| CachedAssetsByClass | TMap< FTopLevelAssetPath, TArray< FAssetData * > > | The map of class name to asset data for assets saved to disk | AssetRegistry/AssetRegistryState.h | |
| CachedAssetsByPackageName | TMap< FName, TArray< FAssetData *, TInlineAllocator< 1 > > > | The map of package names to asset data for assets saved to disk | AssetRegistry/AssetRegistryState.h | |
| CachedAssetsByPath | TMap< FName, TArray< FAssetData * > > | The map of long package path to asset data for assets saved to disk | AssetRegistry/AssetRegistryState.h | |
| CachedAssetsByTag | TMap< FName, TSet< FAssetData * > > | The map of asset tag to asset data for assets saved to disk | AssetRegistry/AssetRegistryState.h | |
| CachedDependsNodes | TMap< FAssetIdentifier, FDependsNode * > | A map of object names to dependency data | AssetRegistry/AssetRegistryState.h | |
| CachedPackageData | TMap< FName, FAssetPackageData * > | A map of Package Names to Package Data | AssetRegistry/AssetRegistryState.h | |
| NumAssets | int32 | Counters for asset/depends data memory allocation to ensure that every FAssetData and FDependsNode created is deleted. | AssetRegistry/AssetRegistryState.h | |
| NumDependsNodes | int32 | AssetRegistry/AssetRegistryState.h | ||
| NumPackageData | int32 | AssetRegistry/AssetRegistryState.h | ||
| PreallocatedAssetDataBuffers | TArray< FAssetData * > | When loading a registry from disk, we can allocate all the FAssetData objects in one chunk, to save on 10s of thousands of heap allocations. | AssetRegistry/AssetRegistryState.h | |
| PreallocatedDependsNodeDataBuffers | TArray< FDependsNode * > | AssetRegistry/AssetRegistryState.h | ||
| PreallocatedPackageDataBuffers | TArray< FAssetPackageData * > | AssetRegistry/AssetRegistryState.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddAssetData
(
FAssetData* AssetData |
Adds the asset data to the lookup maps | AssetRegistry/AssetRegistryState.h | |
void AddDependencies
(
const FAssetIdentifier& AssetIdentifier, |
Add the given dependencies to the given AssetIdentifier (e.g. package). | AssetRegistry/AssetRegistryState.h | |
void AddReferencers
(
const FAssetIdentifier& AssetIdentifier, |
Add a dependency on the given AssetIdentifier (e.g. package) from each of the Referencers. | AssetRegistry/AssetRegistryState.h | |
void AddTagsToAssetData
(
const FSoftObjectPath& InObjectPath, |
Add the given tags/values to the asset data associated with the given object path, if it exists | AssetRegistry/AssetRegistryState.h | |
void ClearDependencies
(
const FAssetIdentifier& AssetIdentifier, |
Clear all dependencies of the given category from the given AssetIdentifier (e.g. package). | AssetRegistry/AssetRegistryState.h | |
void ClearReferencers
(
const FAssetIdentifier& AssetIdentifier, |
Clear all referencers of the given category from the given AssetIdentifier (e.g. package). | AssetRegistry/AssetRegistryState.h | |
bool ContainsDependency
(
const FAssetIdentifier& AssetIdentifier, |
Return whether the supplied package references the query package. | AssetRegistry/AssetRegistryState.h | |
bool ContainsTag
(
FName TagName |
Return whether the given TagName occurs in the tags of any asset in the AssetRegistry | AssetRegistry/AssetRegistryState.h | |
TArray< const FAssetData * > CopyAssetsByPackageName
(
const FName PackageName |
Gets the array of AssetData pointers for the package; does not copy the AssetDatas, just the pointers. | AssetRegistry/AssetRegistryState.h | |
FAssetPackageData * CreateOrGetAssetPackageData
(
FName PackageName |
Finds an existing package data, or creates a new one to modify | AssetRegistry/AssetRegistryState.h | |
bool EnumerateAllAssets
(
const TSet< FName >& PackageNamesToSkip, |
Enumerates asset data for all assets in the registry state, except for assets in packages that are in PackageNamesToSkip. | AssetRegistry/AssetRegistryState.h | |
void EnumerateAllAssets
(
TFunctionRef< void(const FAssetData&)> Callback, |
Enumerates asset data for all assets in the registry state. | AssetRegistry/AssetRegistryState.h | |
void EnumerateAllPaths
(
TFunctionRef< void(FName PathName)> Callback |
Calls the callback with the LongPackageName of each path that has assets as direct children. | AssetRegistry/AssetRegistryState.h | |
bool EnumerateAssets
(
const FARCompiledFilter& Filter, |
Enumerate asset data for all assets that match the filter. | AssetRegistry/AssetRegistryState.h | |
void EnumerateAssetsByClassPathName
(
const FTopLevelAssetPath ClassPathName, |
Enumerates the asset datas for the specified asset class | AssetRegistry/AssetRegistryState.h | |
void EnumerateAssetsByPackageName
(
const FName PackageName, |
Enumerates the asset datas for the specified package name | AssetRegistry/AssetRegistryState.h | |
void EnumerateAssetsByPackagePath
(
FName LongPackagePathName, |
AssetRegistry/AssetRegistryState.h | ||
void EnumerateAssetsByTagName
(
const FName TagName, |
Enumerates the asset datas with the specified asset tag | AssetRegistry/AssetRegistryState.h | |
void EnumerateTags
(
TFunctionRef< bool(FName TagName)> Callback |
Enumerates all tags of any asset in the AssetRegistry | AssetRegistry/AssetRegistryState.h | |
void EnumerateTagToAssetDatas
(
TFunctionRef< bool(FName TagName, IAssetRegistry::FEnumerateAssetDatasFuncEnumerateAssets)> Callback |
Enumerates all tags of any asset in the AssetRegistry including function that can be called to enumerate assets for each tag | AssetRegistry/AssetRegistryState.h | |
void FilterTags
(
const FAssetRegistrySerializationOptions& Options |
Edit every AssetData's Tags to remove Tags that are filtered out by the filtering rules in Options | AssetRegistry/AssetRegistryState.h | |
bool GetAllAssets
(
const TSet< FName >& PackageNamesToSkip, |
Gets asset data for all assets in the registry state. | AssetRegistry/AssetRegistryState.h | |
SIZE_T GetAllocatedSize
(
bool bLogDetailed |
Returns memory size of entire registry, optionally logging sizes | AssetRegistry/AssetRegistryState.h | |
const FAssetData * GetAssetByObjectPath
(
const FSoftObjectPath& ObjectPath |
Gets the asset data for the specified object path | AssetRegistry/AssetRegistryState.h | |
const FAssetData * GetAssetByObjectPath
(
const UE::AssetRegistry::Private::FCachedAssetKey& Key |
AssetRegistry/AssetRegistryState.h | ||
FAssetPackageData * GetAssetPackageData
(
FName PackageName |
AssetRegistry/AssetRegistryState.h | ||
const FAssetPackageData * GetAssetPackageData
(
FName PackageName |
Returns pointer to the asset package data | AssetRegistry/AssetRegistryState.h | |
const FAssetPackageData * GetAssetPackageData
(
FName PackageName, |
AssetRegistry/AssetRegistryState.h | ||
const TMap< FName, const FAssetPackageData * > & GetAssetPackageDataMap() |
Returns const version of internal PackageName->PackageData map for fast iteration | AssetRegistry/AssetRegistryState.h | |
bool GetAssets
(
const FARCompiledFilter& Filter, |
Gets asset data for all assets that match the filter. | AssetRegistry/AssetRegistryState.h | |
bool GetDependencies
(
const FAssetIdentifier& AssetIdentifier, |
AssetRegistry/AssetRegistryState.h | ||
bool GetDependencies
(
const FAssetIdentifier& AssetIdentifier, |
Appends a list of packages and searchable names that are referenced by the supplied package or name. | AssetRegistry/AssetRegistryState.h | |
FName GetFirstPackageByName
(
FStringView PackageName |
Returns the first LongPackageName found for the given PackageName. | AssetRegistry/AssetRegistryState.h | |
int32 GetNumAssets() |
Returns the number of assets in this state | AssetRegistry/AssetRegistryState.h | |
int32 GetNumPackages() |
Returns the number of packages in this state | AssetRegistry/AssetRegistryState.h | |
void GetPackageNames
(
TArray< FName >& OutPackageNames |
Returns all package names | AssetRegistry/AssetRegistryState.h | |
void GetPackagesByName
(
FStringView PackageName, |
Gets the LongPackageNames for all packages with the given PackageName. | AssetRegistry/AssetRegistryState.h | |
void GetPrimaryAssetsIds
(
TSet< FPrimaryAssetId >& OutPrimaryAssets |
Get the set of primary assets contained in this state | AssetRegistry/AssetRegistryState.h | |
bool GetReferencers
(
const FAssetIdentifier& AssetIdentifier, |
Appends a list of packages and searchable names that reference the supplied package or name. | AssetRegistry/AssetRegistryState.h | |
bool GetReferencers
(
const FAssetIdentifier& AssetIdentifier, |
AssetRegistry/AssetRegistryState.h | ||
bool HasAssets
(
const FName PackagePath, |
Does the given path contain assets? This function doesn't recurse into sub-paths. | AssetRegistry/AssetRegistryState.h | |
void InitializeFromExisting
(
const FAssetRegistryState& Existing, |
AssetRegistry/AssetRegistryState.h | ||
void InitializeFromExistingAndPrune
(
const FAssetRegistryState& ExistingState, |
Initializes a cache from an existing using a set of filters. | AssetRegistry/AssetRegistryState.h | |
bool Load
(
FArchive& Ar, |
AssetRegistry/AssetRegistryState.h | ||
int32 NumAssetsByPackageName
(
const FName PackageName |
AssetRegistry/AssetRegistryState.h | ||
void Prune
(
const FAssetRegistryPruneOptions& PruneOptions |
AssetRegistry/AssetRegistryState.h | ||
void PruneAssetData
(
const TSet< FName >& RequiredPackages, |
AssetRegistry/AssetRegistryState.h | ||
void PruneAssetData
(
const TSet< FName >& RequiredPackages, |
Prunes an asset cache, this removes asset data, nodes, and package data that isn't needed. | AssetRegistry/AssetRegistryState.h | |
void RemoveAssetData
(
FAssetData* AssetData, |
Removes the asset data from the lookup maps | AssetRegistry/AssetRegistryState.h | |
void RemoveAssetData
(
const FSoftObjectPath& SoftObjectPath, |
AssetRegistry/AssetRegistryState.h | ||
void RemoveAssetDatas
(
TArrayView< FAssetData* > AssetDatas, |
Removes a set of asset data from the lookup maps. | AssetRegistry/AssetRegistryState.h | |
bool RemovePackageData
(
FName PackageName |
Removes existing package data | AssetRegistry/AssetRegistryState.h | |
void Reset() |
Resets to default state | AssetRegistry/AssetRegistryState.h | |
bool Save
(
FArchive& Ar, |
Save without editor-only data | AssetRegistry/AssetRegistryState.h | |
bool Serialize
(
FArchive& Ar, |
Serialize the registry to/from a file, skipping editor only data | AssetRegistry/AssetRegistryState.h | |
void SetDependencies
(
const FAssetIdentifier& AssetIdentifier, |
Clears existing dependencies of the given Category(s) and assigns the input Dependencies. | AssetRegistry/AssetRegistryState.h | |
void SetReferencers
(
const FAssetIdentifier& AssetIdentifier, |
Clears existing referencers of the given Category(s) and assigns the input Referencers. | AssetRegistry/AssetRegistryState.h | |
void UpdateAssetData
(
const FAssetData& NewAssetData, |
Finds an existing asset data based on object path and updates it with the new value and updates lookup maps | AssetRegistry/AssetRegistryState.h | |
void UpdateAssetData
(
FAssetData&& NewAssetData, |
AssetRegistry/AssetRegistryState.h | ||
void UpdateAssetData
(
FAssetData* AssetData, |
Updates an existing asset data with the new value and updates lookup maps | AssetRegistry/AssetRegistryState.h | |
void UpdateAssetData
(
FAssetData* AssetData, |
AssetRegistry/AssetRegistryState.h | ||
bool UpdateAssetDataPackageFlags
(
FName PackageName, |
Updates all asset data package flags in the specified package | AssetRegistry/AssetRegistryState.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TSharedPtr< FAssetBundleData > FilterBundles
(
const TSharedPtr< FAssetBundleData >& InAssetBundles, |
Filter asset bundles and output a copy of the filtered set or input AssetBundles if nothing was filtered | AssetRegistry/AssetRegistryState.h | |
static void FilterTags
(
const FAssetDataTagMapSharedView& InTagsAndValues, |
Filter a set of tags and output a copy of the filtered set. | AssetRegistry/AssetRegistryState.h | |
static bool IsFilterValid
(
const FARCompiledFilter& Filter |
Checks a filter to make sure there are no illegal entries | AssetRegistry/AssetRegistryState.h | |
static bool LoadFromDisk
(
const TCHAR* InPath, |
Example Usage: FAssetRegistryState AR; bool bSucceeded = FAssetRegistryState::LoadFromDisk(TEXT("Path/To/AR"), FAssetRegistryLoadOptions(), AR); | AssetRegistry/AssetRegistryState.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FAssetRegistryState & operator=
(
FAssetRegistryState&& O |
AssetRegistry/AssetRegistryState.h | ||
FAssetRegistryState & operator=
(
const FAssetRegistryState& |
AssetRegistry/AssetRegistryState.h |