FAssetRegistryState

The state of an asset registry, this is used internally by [IAssetRegistry](API\Runtime\AssetRegistry\AssetRegistry\IAssetRegistry) to represent the disk cache, and is also accessed directly to save/load cooked caches

Choose your operating system:

Windows

macOS

Linux

References

Module

AssetRegistry

Header

/Engine/Source/Runtime/AssetRegistry/Public/AssetRegistry/AssetRegistryState.h

Include

#include "AssetRegistry/AssetRegistryState.h"

Syntax

class FAssetRegistryState

Remarks

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

Constructors

Destructors

Name Description

Public function

~FAssetRegistryState()

Functions

Name Description

Public function

void

 

AddAssetData

(
    FAssetData* AssetData
)

Adds the asset data to the lookup maps

Public function

FAssetPackag...

 

CreateOrGetAssetPackageData

(
    FName PackageName
)

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

Public function Const

void

 

Dump

(
    const TArray< FString >& Arguments,
    TArray< FString >& OutPages,
    int32 LinesPerPage
)

Writes out the state in textual form. Use arguments to control which segments to emit.

Public function Const

bool

 

EnumerateAllAssets

(
    const TSet< FName >& PackageNamesT...,
    TFunctionRef< bool...,
    bool bARFiltering
)

Enumerates asset data for all assets in the registry state.

Public function Const

bool

 

EnumerateAssets

(
    const FARCompiledFilter& Filter,
    const TSet< FName >& PackageNamesT...,
    TFunctionRef< bool...,
    bool bARFiltering
)

Enumerate asset data for all assets that match the filter.

Public function Const

bool

 

GetAllAssets

(
    const TSet< FName >& PackageNamesT...,
    TArray< FAssetData >& OutAssetData,
    bool bARFiltering
)

Gets asset data for all assets in the registry state.

Public function Const

SIZE_T

 

GetAllocatedSize

(
    bool bLogDetailed
)

Returns memory size of entire registry, optionally logging sizes

Public function Const

const FAsset...

 

GetAssetByObjectPath

(
    const FName ObjectPath
)

Gets the asset data for the specified object path

Public function Const

const FAsset...

 

GetAssetPackageData

(
    FName PackageName
)

Returns non-editable pointer to the asset package data

Public function Const

const TMap< ...

 

GetAssetPackageDataMap()

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

Public function Const

bool

 

GetAssets

(
    const FARCompiledFilter& Filter,
    const TSet< FName >& PackageNamesT...,
    TArray< FAssetData >& OutAssetData,
    bool bARFiltering
)

Gets asset data for all assets that match the filter.

Public function Const

const TArray...

 

GetAssetsByClassName

(
    const FName ClassName
)

Gets the asset data for the specified asset class

Public function Const

TArrayView< ...

 

GetAssetsByPackageName

(
    const FName PackageName
)

Gets the asset data for the specified package name

Public function Const

const TArray...

 

GetAssetsByTagName

(
    const FName TagName
)

Gets the asset data for the specified asset tag

Public function Const

bool

 

GetDependencies

(
    const FAssetIdentifier& AssetIdent...,
    TArray< FAssetIdentifier >& OutDep...,
    UE::AssetRegistry::EDependencyCateg...,
    const UE::AssetRegistry::FDependenc...
)

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

Public function Const

FName

 

GetFirstPackageByName

(
    FStringView PackageName
)

Returns the first LongPackageName found for the given PackageName.

Public function Const

int32

 

GetNumAssets()

Returns the number of assets in this state

Public function Const

int32

 

GetNumPackages()

Returns the number of packages in this state

Public function Const

const TMap< ...

 

GetObjectPathToAssetDataMap()

Returns const version of internal ObjectPath->AssetData map for fast iteration

Public function Const

void

 

GetPackageNames

(
    TArray< FName >& OutPackageNames
)

Returns all package names

Public function Const

void

 

GetPackagesByName

(
    FStringView PackageName,
    TArray< FName >& OutPackageNames
)

Gets the LongPackageNames for all packages with the given PackageName.

Public function Const

void

 

GetPrimaryAssetsIds

(
    TSet< FPrimaryAssetId >& OutPrimar...
)

Get the set of primary assets contained in this state

Public function Const

bool

 

GetReferencers

(
    const FAssetIdentifier& AssetIdent...,
    TArray< FAssetIdentifier >& OutRef...,
    UE::AssetRegistry::EDependencyCateg...,
    const UE::AssetRegistry::FDependenc...
)

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

Public function Const

const TMap< ...

 

GetTagToAssetDatasMap()

Returns const version of internal Tag->AssetDatas map for fast iteration

Public function Const

bool

 

HasAssets

(
    const FName PackagePath,
    bool bARFiltering
)

Does the given path contain assets?

Public function

void

 

InitializeFromExisting

(
    const TMap< FName, FAssetData*...,
    const TMap< FAssetIdentifier, FDepe...,
    const TMap< FName, FAssetPackageDat...,
    const FAssetRegistrySerializationOp...,
    EInitializationMode InitializationM...
)

Initializes cache from existing set of asset data and depends nodes

Public function

void

 

InitializeFromExisting

(
    const FAssetRegistryState& Existin...,
    const FAssetRegistrySerializationOp...,
    EInitializationMode InitializationM...
)

Initializes cache from existing set of asset data and depends nodes

Public function

void

 

InitializeFromExistingAndPrune

(
    const FAssetRegistryState& Existin...,
    const TSet< FName >& RequiredPacka...,
    const TSet< FName >& RemovePackage...,
    const TSet< int32 > ChunksToKeep,
    const FAssetRegistrySerializationOp...
)

Initializes a cache from an existing using a set of filters.

Public function Static

bool

 

IsFilterValid

(
    const FARCompiledFilter& Filter
)

Checks a filter to make sure there are no illegal entries

Public function

bool

 

Load

(
    FArchive& Ar,
    const FAssetRegistryLoadOptions& O...
)

Public function

void

 

PruneAssetData

(
    const TSet< FName >& RequiredPacka...,
    const TSet< FName >& RemovePackage...,
    const FAssetRegistrySerializationOp...
)

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

Public function

void

 

PruneAssetData

(
    const TSet< FName >& RequiredPacka...,
    const TSet< FName >& RemovePackage...,
    const TSet< int32 > ChunksToKeep,
    const FAssetRegistrySerializationOp...
)

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

Public function

void

 

RemoveAssetData

(
    FAssetData* AssetData,
    bool bRemoveDependencyData,
    bool& bOutRemovedAssetData,
    bool& bOutRemovedPackageData
)

Removes the asset data from the lookup maps

Public function

bool

 

RemovePackageData

(
    FName PackageName
)

Removes existing package data

Public function

void

 

Reset()

Resets to default state

Public function

bool

 

Save

(
    FArchive& Ar,
    const FAssetRegistrySerializationOp...
)

Save without editor-only data

Public function

bool

 

Serialize

(
    FArchive& Ar,
    const FAssetRegistrySerializationOp...
)

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

Public function

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

Public function

void

 

UpdateAssetData

(
    FAssetData* AssetData,
    const FAssetData& NewAssetData
)

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

Public function

bool

 

UpdateAssetDataPackageFlags

(
    FName PackageName,
    uint32 PackageFlags
)

Updates all asset data package flags in the specified package

Operators

Name Description

Public function

FAssetRegist...

 

operator=

(
    const FAssetRegistryState&
)

Public function

FAssetRegist...

 

operator=

(
    FAssetRegistryState&& O
)

Enums

Name

Description

Public enum

EInitializationMode

Enum controlling how we initialize this state

Deprecated Functions

Name Description

Public function Const

bool

 

GetDependencies

(
    const FAssetIdentifier& AssetIdent...,
    TArray< FAssetIdentifier >& OutDep...,
    EAssetRegistryDependencyType::Type ...
)

Use GetDependencies that takes a UE::AssetRegistry::EDependencyCategory instead

Public function Const

bool

 

GetDependencies

(
    const FAssetIdentifier& AssetIdent...,
    TArray< FAssetDependency >& OutDep...,
    UE::AssetRegistry::EDependencyCateg...,
    const UE::AssetRegistry::FDependenc...
)

Use GetDependencies that takes a UE::AssetRegistry::EDependencyCategory instead

Public function Const

bool

 

GetReferencers

(
    const FAssetIdentifier& AssetIdent...,
    TArray< FAssetDependency >& OutRef...,
    UE::AssetRegistry::EDependencyCateg...,
    const UE::AssetRegistry::FDependenc...
)

Use GetReferencers that takes a UE::AssetRegistry::EDependencyCategory instead

Public function Const

bool

 

GetReferencers

(
    const FAssetIdentifier& AssetIdent...,
    TArray< FAssetIdentifier >& OutRef...,
    EAssetRegistryDependencyType::Type ...
)

Use GetReferencers that takes a UE::AssetRegistry::EDependencyCategory instead