FAssetRegistryState

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

Windows
MacOS
Linux

References

Module

AssetRegistry

Header

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

Include

#include "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

Name Description

Public function

FAssetRegistryState()

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 >& OutLines
)

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...
)

Enumerates asset data for all assets in the registry state.

Public function Const

bool

 

EnumerateAssets

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

Enumerate asset data for all assets that match the filter.

Public function Const

bool

 

GetAllAssets

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

Gets asset data for all assets in the registry state.

Public function Const

uint32

 

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 FARFilter& Filter,
    const TSet< FName >& PackageNamesT...,
    TArray< FAssetData >& OutAssetData
)

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

const TArray...

 

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...,
    EAssetRegistryDependencyType::Type ...
)

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

Public function Const

int32

 

GetNumAssets()

Returns the number of assets in this state

Public function Const

const TMap< ...

 

GetObjectPathToAssetDataMap()

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

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...,
    EAssetRegistryDependencyType::Type ...
)

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
)

Does the given path contain assets?

This function doesn't recurse into sub-paths.

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 FARFilter& Filter,
    bool bAllowRecursion
)

Checks a filter to make sure there are no illegal entries

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

 

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

bool

 

RemoveAssetData

(
    FAssetData* AssetData,
    bool bRemoveDependencyData
)

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

 

Serialize

(
    FArchive& Ar,
    const FAssetRegistrySerializationOp...
)

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

Public function

void

 

StripAssetRegistryKeyForObject

(
    FName ObjectPath,
    FName Key
)

Removes a key from the key value pairs for an object

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

Enums

Name

Description

Public enum

EInitializationMode

Enum controlling how we initialize this state

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss