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
| bool FAssetRegistryState::EnumerateAllAssets | ( | const TSet< FName > & | PackageNamesToSkip, |
| TFunctionRef< bool(const FAssetData &)> | Callback | ||
| ) | const |
Enumerates asset data for all assets in the registry state.
| PackageNamesToSkip | explicit list of packages to skip, because they were already added |
| Callback | function to call for each asset data enumerated |
| 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.
| Filter | filter to apply to the assets in the AssetRegistry |
| PackageNamesToSkip | explicit list of packages to skip, because they were already added |
| Callback | function to call for each asset data enumerated |
| bool FAssetRegistryState::GetAllAssets | ( | const TSet< FName > & | PackageNamesToSkip, |
| TArray< FAssetData > & | OutAssetData | ||
| ) | const |
Gets asset data for all assets in the registry state.
| PackageNamesToSkip | explicit list of packages to skip, because they were already added |
| OutAssetData | the list of assets |
|
inline |
Gets the asset data for the specified object path
| ObjectPath | the path of the object to be looked up |
| 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.
| Filter | filter to apply to the assets in the AssetRegistry |
| PackageNamesToSkip | explicit list of packages to skip, because they were already added |
| OutAssetData | the list of assets in this path |
|
inline |
Gets the asset data for the specified asset class
| ClassName | the class name of the assets to look for |
|
inline |
Gets the asset data for the specified package name
| PackageName | the path of the package to be looked up |
|
inline |
Gets the asset data for the specified asset tag
| TagName | the tag name to search for |
| 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)
| AssetIdentifier | the name of the package/name for which to gather dependencies |
| OutDependencies | a list of things that are referenced by AssetIdentifier |
| Category | which category(ies) of dependencies to include in the output list. Dependencies matching ANY of the OR'd categories will be returned. |
| Flags | which 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. |
| 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)
| AssetIdentifier | the name of the package/name for which to gather dependencies |
| OutReferencers | a list of things that reference AssetIdentifier |
| Category | which category(ies) of dependencies to include in the output list. Dependencies matching ANY of the OR'd categories will be returned. |
| Flags | which 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. |
| bool FAssetRegistryState::HasAssets | ( | const FName | PackagePath | ) | const |
Does the given path contain assets?
| 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.
| ExistingState | State to use initialize from |
| RequiredPackages | If set, only these packages will be maintained. If empty it will keep all unless filtered by other parameters |
| RemovePackages | These packages will be removed from the current set |
| ChunksToKeep | The list of chunks that are allowed to remain. Any assets in other chunks are pruned. If empty, all assets are kept regardless of chunk |
| Options | Serialization options to read filter info from |
| 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.
| RequiredPackages | If set, only these packages will be maintained. If empty it will keep all unless filtered by other parameters |
| RemovePackages | These packages will be removed from the current set |
| ChunksToKeep | The list of chunks that are allowed to remain. Any assets in other chunks are pruned. If empty, all assets are kept regardless of chunk |
| Options | Serialization options to read filter info from |
Removes a key from the key value pairs for an object
| ObjectPath | the path of the object to be trimmed |
| Key | the key to remove |