engine
 
载入中...
搜索中...
未找到
Public 类型 | Public 成员函数 | 静态 Public 成员函数 | 所有成员列表
FAssetRegistryState类 参考

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 更多...

#include <AssetRegistryState.h>

Public 类型

enum class  EInitializationMode
 Enum controlling how we initialize this state
 

Public 成员函数

void AddAssetData (FAssetData *AssetData)
 Adds the asset data to the lookup maps
 
FAssetPackageData * CreateOrGetAssetPackageData (FName PackageName)
 Finds an existing package data, or creates a new one to modify
 
bool EnumerateAllAssets (const TSet< FName > &PackageNamesToSkip, TFunctionRef< bool(const FAssetData &)> Callback) const
 Enumerates asset data for all assets in the registry state. 更多...
 
bool EnumerateAssets (const FARCompiledFilter &Filter, const TSet< FName > &PackageNamesToSkip, TFunctionRef< bool(const FAssetData &)> Callback) const
 Enumerate asset data for all assets that match the filter. 更多...
 
bool GetAllAssets (const TSet< FName > &PackageNamesToSkip, TArray< FAssetData > &OutAssetData) const
 Gets asset data for all assets in the registry state. 更多...
 
uint32 GetAllocatedSize (bool bLogDetailed=false) const
 Returns memory size of entire registry, optionally logging sizes
 
const FAssetData * GetAssetByObjectPath (const FName ObjectPath) const
 Gets the asset data for the specified object path 更多...
 
const FAssetPackageData * GetAssetPackageData (FName PackageName) const
 Returns non-editable pointer to the asset package data
 
const TMap< FName, const FAssetPackageData * > & GetAssetPackageDataMap () const
 Returns const version of internal PackageName->PackageData map for fast iteration
 
bool GetAssets (const FARCompiledFilter &Filter, const TSet< FName > &PackageNamesToSkip, TArray< FAssetData > &OutAssetData) const
 Gets asset data for all assets that match the filter. 更多...
 
const TArray< const FAssetData * > & GetAssetsByClassName (const FName ClassName) const
 Gets the asset data for the specified asset class 更多...
 
const TArray< const FAssetData * > & GetAssetsByPackageName (const FName PackageName) const
 Gets the asset data for the specified package name 更多...
 
const TArray< const FAssetData * > & GetAssetsByTagName (const FName TagName) const
 Gets the asset data for the specified asset tag 更多...
 
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
 Gets a list of packages and searchable names that are referenced by the supplied package or name. 更多...
 
int32 GetNumAssets () const
 Returns the number of assets in this state
 
const TMap< FName, const FAssetData * > & GetObjectPathToAssetDataMap () const
 Returns const version of internal ObjectPath->AssetData map for fast iteration
 
void GetPackageNames (TArray< FName > &OutPackageNames) const
 Returns all package names
 
void GetPrimaryAssetsIds (TSet< FPrimaryAssetId > &OutPrimaryAssets) const
 Get the set of primary assets contained in this state
 
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
 Gets a list of packages and searchable names that reference the supplied package or name. 更多...
 
const TMap< FName, const TArray< const FAssetData * > > GetTagToAssetDatasMap () const
 Returns const version of internal Tag->AssetDatas map for fast iteration
 
bool HasAssets (const FName PackagePath) const
 Does the given path contain assets? 更多...
 
void InitializeFromExisting (const TMap< FName, FAssetData * > &AssetDataMap, const TMap< FAssetIdentifier, FDependsNode * > &DependsNodeMap, const TMap< FName, FAssetPackageData * > &AssetPackageDataMap, const FAssetRegistrySerializationOptions &Options, EInitializationMode InitializationMode=EInitializationMode::Rebuild)
 Initializes cache from existing set of asset data and depends nodes
 
void 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. 更多...
 
void 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. 更多...
 
void RemoveAssetData (FAssetData *AssetData, bool bRemoveDependencyData, bool &bOutRemovedAssetData, bool &bOutRemovedPackageData)
 Removes the asset data from the lookup maps
 
bool RemovePackageData (FName PackageName)
 Removes existing package data
 
void Reset ()
 Resets to default state
 
bool Serialize (FArchive &Ar, const FAssetRegistrySerializationOptions &Options)
 Serialize the registry to/from a file, skipping editor only data
 
void StripAssetRegistryKeyForObject (FName ObjectPath, FName Key)
 Removes a key from the key value pairs for an object 更多...
 
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
 
void UpdateAssetData (FAssetData *AssetData, const FAssetData &NewAssetData)
 Updates an existing asset data with the new value and updates lookup maps
 

静态 Public 成员函数

static bool IsFilterValid (const FARCompiledFilter &Filter)
 Checks a filter to make sure there are no illegal entries
 

详细描述

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

成员函数说明

◆ EnumerateAllAssets()

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

Enumerates asset data for all assets in the registry state.

参数
PackageNamesToSkipexplicit list of packages to skip, because they were already added
Callbackfunction to call for each asset data enumerated

◆ EnumerateAssets()

bool FAssetRegistryState::EnumerateAssets ( const FARCompiledFilter &  Filter,
const TSet< FName > &  PackageNamesToSkip,
TFunctionRef< bool(const FAssetData &)>  Callback 
) 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.

参数
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

◆ GetAllAssets()

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

Gets asset data for all assets in the registry state.

参数
PackageNamesToSkipexplicit list of packages to skip, because they were already added
OutAssetDatathe list of assets

◆ GetAssetByObjectPath()

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

Gets the asset data for the specified object path

参数
ObjectPaththe path of the object to be looked up
返回
the assets data, null if not found

◆ GetAssets()

bool FAssetRegistryState::GetAssets ( const FARCompiledFilter &  Filter,
const TSet< FName > &  PackageNamesToSkip,
TArray< FAssetData > &  OutAssetData 
) 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.

参数
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

◆ GetAssetsByClassName()

const TArray< const FAssetData * > & FAssetRegistryState::GetAssetsByClassName ( const FName  ClassName) const
inline

Gets the asset data for the specified asset class

参数
ClassNamethe class name of the assets to look for
返回
An array of AssetData*, empty if nothing found

◆ GetAssetsByPackageName()

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

Gets the asset data for the specified package name

参数
PackageNamethe path of the package to be looked up
返回
an array of AssetData*, empty if nothing found

◆ GetAssetsByTagName()

const TArray< const FAssetData * > & FAssetRegistryState::GetAssetsByTagName ( const FName  TagName) const
inline

Gets the asset data for the specified asset tag

参数
TagNamethe tag name to search for
返回
An array of AssetData*, empty if nothing found

◆ GetDependencies()

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

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

(On disk references ONLY)

参数
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.

◆ GetReferencers()

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

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

(On disk references ONLY)

参数
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) const

Does the given path contain assets?

注解
This function doesn't recurse into sub-paths.

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

参数
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

◆ PruneAssetData()

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.

参数
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

◆ StripAssetRegistryKeyForObject()

void FAssetRegistryState::StripAssetRegistryKeyForObject ( FName  ObjectPath,
FName  Key 
)

Removes a key from the key value pairs for an object

参数
ObjectPaththe path of the object to be trimmed
Keythe key to remove

该类的文档由以下文件生成: