IAssetRegistry

Choose your operating system:

Windows

macOS

Linux

References

Module

AssetRegistry

Header

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

Include

#include "AssetRegistry/IAssetRegistry.h"

Syntax

class IAssetRegistry

Functions

Name Description

Public function

bool

 

AddPath

(
    const FString& PathToAdd
)

Adds the specified path to the set of cached paths.

Public function

void

 

AppendState

(
    const FAssetRegistryState& InState
)

Append the assets from the incoming state into our own

Public function

void

 

AssetCreated

(
    UObject* NewAsset
)

Informs the asset registry that an in-memory asset has been created

Public function

void

 

AssetDeleted

(
    UObject* DeletedAsset
)

Informs the asset registry that an in-memory asset has been deleted

Public function

void

 

AssetRenamed

(
    const UObject* RenamedAsset,
    const FString& OldObjectPath
)

Informs the asset registry that an in-memory asset has been renamed

Public function

void

 

AssetSaved

(
    const UObject& SavedAsset
)

Informs the asset registry that an in-memory asset has been saved

Public function Const

void

 

CompileFilter

(
    const FARFilter& InFilter,
    FARCompiledFilter& OutCompiledFilt...
)

Modifies passed in filter optimize it for query and expand any recursive paths and classes

Public function Const

bool

 

ContainsTag

(
    FName TagName
)

Return whether the given TagName occurs in the tags of any asset in the AssetRegistry

Public function Const

void

 

DumpState

(
    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

(
    TFunctionRef< bool...,
    bool bIncludeOnlyOnDiskAssets
)

Enumerate asset data for all assets in the registry.

Public function Const

void

 

EnumerateAllCachedPaths

(
    TFunctionRef< bool)> Callback
)

Enumerate all the paths that are currently cached

Public function Const

void

 

EnumerateAllCachedPaths

(
    TFunctionRef< bool)> Callba...
)

Enumerate all the paths that are currently cached

Public function Const

bool

 

EnumerateAssets

(
    const FARCompiledFilter& Filter,
    TFunctionRef< bool...
)

Public function Const

bool

 

EnumerateAssets

(
    const FARFilter& Filter,
    TFunctionRef< bool...
)

Enumerate asset data for all assets that match the filter.

Public function Const

void

 

EnumerateSubPaths

(
    const FString& InBasePath,
    TFunctionRef< bool)> Callba...,
    bool bInRecurse
)

Enumerate the all paths that are currently cached below the passed-in base path

Public function Const

void

 

EnumerateSubPaths

(
    const FName InBasePath,
    TFunctionRef< bool)> Callback,
    bool bInRecurse
)

Enumerate the all paths that are currently cached below the passed-in base path

Public function Static

IAssetRegist...

 

Get()

Public function Const

bool

 

GetAllAssets

(
    TArray< FAssetData >& OutAssetData,
    bool bIncludeOnlyOnDiskAssets
)

Gets asset data for all assets in the registry.

Public function Const

void

 

GetAllCachedPaths

(
    TArray< FString >& OutPathList
)

Gets a list of all paths that are currently cached

Public function Const

SIZE_T

 

GetAllocatedSize

(
    bool bLogDetailed
)

Returns memory size of entire registry, optionally logging sizes

Public function Const

bool

 

GetAncestorClassNames

(
    FName ClassName,
    TArray< FName >& OutAncestorClassN...
)

Returns true if the specified ClassName's ancestors could be found.

Public function Const

EAssetAvaila...

 

GetAssetAvailability

(
    const FAssetData& AssetData
)

Gets the current availability of an asset, primarily for streaming install purposes.

Public function Const

float

 

GetAssetAvailabilityProgress

(
    const FAssetData& AssetData,
    EAssetAvailabilityProgressReporting...
)

Gets an ETA or percentage complete for an asset that is still in the process of being installed.

Public function Const

bool

 

GetAssetAvailabilityProgressTypeSupported

Public function Const

FAssetData

 

GetAssetByObjectPath

(
    const FName ObjectPath,
    bool bIncludeOnlyOnDiskAssets
)

Gets the asset data for the specified object path

Public function Const

TOptional< F...

 

GetAssetPackageDataCopy

(
    FName PackageName
)

Finds Package data for a package name.

Public function Const

bool

 

GetAssets

(
    const FARFilter& Filter,
    TArray< FAssetData >& OutAssetData
)

Gets asset data for all assets that match the filter.

Public function Const

bool

 

GetAssetsByClass

(
    FName ClassName,
    TArray< FAssetData >& OutAssetData,
    bool bSearchSubClasses
)

Gets asset data for all assets with the supplied class

Public function Const

bool

 

GetAssetsByPackageName

(
    FName PackageName,
    TArray< FAssetData >& OutAssetData,
    bool bIncludeOnlyOnDiskAssets
)

Gets asset data for the assets in the package with the specified package name

Public function Const

bool

 

GetAssetsByPath

(
    FName PackagePath,
    TArray< FAssetData >& OutAssetData,
    bool bRecursive,
    bool bIncludeOnlyOnDiskAssets
)

Gets asset data for all assets in the supplied folder path

Public function Const

bool

 

GetAssetsByPaths

(
    TArray< FName > PackagePaths,
    TArray< FAssetData >& OutAssetData,
    bool bRecursive,
    bool bIncludeOnlyOnDiskAssets
)

Gets asset data for all assets in any of the supplied folder paths

Public function Const

bool

 

GetAssetsByTags

(
    const TArray< FName >& AssetTags,
    TArray< FAssetData >& OutAssetData
)

Gets asset data for all assets with the supplied tags, regardless of their value

Public function Const

bool

 

GetAssetsByTagValues

(
    const TMultiMap< FName, FString >&...,
    TArray< FAssetData >& OutAssetData
)

Gets asset data for all assets with the supplied tags and values

Public function Const

TSet< FName ...

 

GetCachedEmptyPackagesCopy()

Returns the set of empty package names fast iteration

Public function Static

IAssetRegist...

 

GetChecked()

Public function Const

bool

 

GetDependencies

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

Public function Const

bool

 

GetDependencies

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

Gets a list of AssetIdentifiers or FAssetDependencies that are referenced by the supplied AssetIdentifier.

Public function Const

bool

 

GetDependencies

(
    FName PackageName,
    TArray< FName >& OutDependencies,
    UE::AssetRegistry::EDependencyCateg...,
    const UE::AssetRegistry::FDependenc...
)

Gets a list of PackageNames that are referenced by the supplied package. (On disk references ONLY)

Public function Const

void

 

GetDerivedClassNames

(
    const TArray< FName >& ClassNames,
    const TSet< FName >& ExcludedClass...,
    TSet< FName >& OutDerivedClassName...
)

Returns the names of all classes derived by the supplied class names, excluding any classes matching the excluded class names.

Public function Const

FName

 

GetFirstPackageByName

(
    FStringView PackageName
)

Returns the first LongPackageName found for the given PackageName.

Public function Const

void

 

GetPackagesByName

(
    FStringView PackageName,
    TArray< FName >& OutPackageNames
)

Gets the LongPackageName for all packages with the given PackageName.

Public function Const

FName

 

GetRedirectedObjectPath

(
    const FName ObjectPath
)

Uses the asset registry to look for ObjectRedirectors.

Public function Const

bool

 

GetReferencers

(
    FName PackageName,
    TArray< FName >& OutReferencers,
    UE::AssetRegistry::EDependencyCateg...,
    const UE::AssetRegistry::FDependenc...
)

Gets a list of PackageNames that reference the supplied package. (On disk references ONLY)

Public function Const

bool

 

GetReferencers

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

Public function Const

bool

 

GetReferencers

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

Gets a list of AssetIdentifiers or FAssetDependencies that reference the supplied AssetIdentifier.

Public function Const

void

 

GetSubPaths

(
    const FString& InBasePath,
    TArray< FString >& OutPathList,
    bool bInRecurse
)

Gets a list of all paths that are currently cached below the passed-in base path

Public function Const

bool

 

GetTemporaryCachingMode()

Returns true if temporary caching mode enabled

Public function Const

bool

 

HasAssets

(
    const FName PackagePath,
    const bool bRecursive
)

Does the given path contain assets, optionally also testing sub-paths?

Public function Const

void

 

InitializeSerializationOptions

(
    FAssetRegistrySerializationOptions ...,
    const FString& PlatformIniName,
    UE::AssetRegistry::ESerializationTa...
)

Fills in FAssetRegistrySerializationOptions from ini, optionally using a target platform ini name

Public function Const

void

 

InitializeTemporaryAssetRegistryState

(
    FAssetRegistryState& OutState,
    const FAssetRegistrySerializationOp...,
    bool bRefreshExisting,
    const TMap< FName, FAssetData*...
)

Fills in a AssetRegistryState with a copy of the data in the internal cache, overriding some

Public function Const

bool

 

IsAssetExcludedByFilter

(
    const FAssetData& AssetData,
    const FARCompiledFilter& Filter
)

Tests to see whether the given asset would be excluded (fails) the given filter

Public function Const

bool

 

IsAssetIncludedByFilter

(
    const FAssetData& AssetData,
    const FARCompiledFilter& Filter
)

Tests to see whether the given asset would be included (passes) the given filter

Public function Const

bool

 

IsLoadingAssets()

Returns true if the asset registry is currently loading files and does not yet know about all assets

Public function Const

bool

 

IsPathBeautificationNeeded

(
    const FString& InAssetPath
)

Indicates if path should be beautified before presented to the user.

Public function Const

bool

 

IsSearchAllAssets()

Whether SearchAllAssets has been called, or was auto-called at startup.

Public function Const

bool

 

IsSearchAsync()

Whether searching is done async (and was started at startup), or synchronously and on-demand, requiring ScanPathsSynchronous or SearchAllAssets.

Public function Virtual Const

bool

 

K2_GetDependencies

(
    FName PackageName,
    const FAssetRegistryDependencyOptio...,
    TArray< FName >& OutDependencies
)

Gets a list of paths to objects that are referenced by the supplied package.

Public function Virtual Const

bool

 

K2_GetReferencers

(
    FName PackageName,
    const FAssetRegistryDependencyOptio...,
    TArray< FName >& OutReferencers
)

Gets a list of packages that reference the supplied package. (On disk references ONLY)

Public function Const

void

 

LoadPackageRegistryData

(
    const FString& PackageFilename,
    FLoadPackageRegistryData& InOutDat...
)

Load FAssetData from the specified package filename

Public function Const

void

 

LoadPackageRegistryData

(
    FArchive& Ar,
    FLoadPackageRegistryData& InOutDat...
)

Load FPackageRegistry data from the supplied package

Public function

FAssetAddedE...

 

OnAssetAdded()

Public function

FAssetRemove...

 

OnAssetRemoved()

Public function

FAssetRename...

 

OnAssetRenamed()

Public function

FAssetUpdate...

 

OnAssetUpdated()

Public function

FAssetUpdate...

 

OnAssetUpdatedOnDisk()

Event for when assets are updated on disk and have been refreshed in the assetregistry

Public function

FFileLoadPro...

 

OnFileLoadProgressUpdated()

Public function

FFilesLoaded...

 

OnFilesLoaded()

Public function

FInMemoryAss...

 

OnInMemoryAssetCreated()

Public function

FInMemoryAss...

 

OnInMemoryAssetDeleted()

Public function

FPathAddedEv...

 

OnPathAdded()

Public function

FPathRemoved...

 

OnPathRemoved()

Public function

void

 

PackageDeleted

(
    UPackage* DeletedPackage
)

Informs the asset registry that an in-memory package has been deleted, and all associated assets should be removed

Public function Const

bool

 

PathExists

(
    const FName PathToTest
)

Public function Const

bool

 

PathExists

(
    const FString& PathToTest
)

Queries whether the given path exists in the set of cached paths

Public function Const

void

 

PrioritizeAssetInstall

(
    const FAssetData& AssetData
)

Hint the streaming installers to prioritize a specific asset for install.

Public function

void

 

PrioritizeSearchPath

(
    const FString& PathToPrioritize
)

If assets are currently being asynchronously scanned in the specified path, this will cause them to be scanned before other assets.

Public function Const

void

 

ReadLockEnumerateTagToAssetDatas

(
    TFunctionRef< void TagName, c...
)

Enumerate all pairs in State->TagToAssetDataMapAssetRegistry and call a callback on each pair.

Public function

bool

 

RemovePath

(
    const FString& PathToRemove
)

Attempts to remove the specified path to the set of cached paths.

Public function Const

void

 

RunAssetsThroughFilter

(
    TArray< FAssetData >& AssetDataLis...,
    const FARFilter& Filter
)

Trims items out of the asset data list that do not pass the supplied filter

Public function

void

 

ScanFilesSynchronous

(
    const TArray< FString >& InFilePat...,
    bool bForceRescan
)

Scan the specified individual files right now and populate the asset registry.

Public function

void

 

ScanModifiedAssetFiles

(
    const TArray< FString >& InFilePat...
)

Forces a rescan of specific filenames, call this when you need to refresh from disk

Public function

void

 

ScanPathsSynchronous

(
    const TArray< FString >& InPaths,
    bool bForceRescan,
    bool bIgnoreDenyListScanFilters
)

Scan the supplied paths recursively right now and populate the asset registry.

Public function

void

 

SearchAllAssets

(
    bool bSynchronousSearch
)

Look for all assets on disk (can be async or synchronous)

Public function

void

 

Serialize

(
    FArchive& Ar
)

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

Public function

void

 

Serialize

(
    FStructuredArchive::FRecord Record
)

Protected function

void

 

SetManageReferences

(
    const TMultiMap< FAssetIdentifier, ...,
    bool bClearExisting,
    UE::AssetRegistry::EDependencyCateg...,
    TSet< FDependsNode* >& Existi...,
    ShouldSetManagerPredicate ShouldSet...
)

Specifies a list of manager mappings, optionally recursing to dependencies.

Protected function

bool

 

SetPrimaryAssetIdForObjectPath

(
    const FName ObjectPath,
    FPrimaryAssetId PrimaryAssetId
)

Sets the PrimaryAssetId for a specific asset.

Public function

void

 

SetTemporaryCachingMode

(
    bool bEnable
)

Enables or disable temporary search caching, when this is enabled scanning/searching is faster because we assume no objects are loaded between scans.

Public function

void

 

SetTemporaryCachingModeInvalidated()

Mark that the temporary cached needs to be updated before being used again, because e.g. a new class was loaded.

Public function

void

 

Tick

(
    float DeltaTime
)

Tick the asset registry

Public function Const

void

 

UseFilterToExcludeAssets

(
    TArray< FAssetData >& AssetDataLis...,
    const FARFilter& Filter
)

Trims items out of the asset data list that pass the supplied filter

Public function

void

 

WaitForCompletion()

Wait for scan to be complete.

Public function

void

 

WaitForPackage

(
    const FString& PackageName
)

Wait for the scan of a specific package to be complete

Classes

Name

Description

Public class

FAssetAddedEvent

Event for when assets are added to the registry

Public class

FAssetRemovedEvent

Event for when assets are removed from the registry

Public class

FAssetRenamedEvent

Event for when assets are renamed in the registry

Public class

FAssetUpdatedEvent

Event for when assets are updated in the registry

Public struct

FFileLoadProgressUpdateData

Payload data for a file progress update

Public class

FFileLoadProgressUpdatedEvent

Event to update the progress of the background file load

Public class

FFilesLoadedEvent

Event for when the asset registry is done loading files

Public class

FInMemoryAssetCreatedEvent

Event for when in-memory assets are created

Public class

FInMemoryAssetDeletedEvent

Event for when assets are deleted

Public struct

FLoadPackageRegistryData

Public class

FPathAddedEvent

Event for when paths are added to the registry

Public class

FPathRemovedEvent

Event for when paths are removed from the registry

Typedefs

Name

Description

ShouldSetManagerPredicate

Predicate called to decide whether to recurse into a reference when setting manager references

Deprecated Functions

Name Description

Public function Const

void

 

ExpandRecursiveFilter

(
    const FARFilter& InFilter,
    FARFilter& ExpandedFilter
)

ExpandRecursiveFilter is deprecated in favor of CompileFilter

Public function Const

const FAsset...

 

GetAssetPackageData

(
    FName PackageName
)

Receiving a pointer is not threadsafe. Use GetAssetPackageDataCopy instead.

Public function Const

const FAsset...

 

GetAssetRegistryState()

Receiving a pointer is not threadsafe. Use other functions on IAssetRegistry to access the same data, or contact Epic Core team to add the threadsafe functions you require..

Public function Const

const TSet< ...

 

GetCachedEmptyPackages()

Receiving a reference is not threadsafe. Use GetCachedEmptyPackagesCopy instead.

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

(
    FName PackageName,
    TArray< FName >& OutDependencies,
    EAssetRegistryDependencyType::Type ...
)

Use GetDependencies 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

Public function Const

bool

 

GetReferencers

(
    FName PackageName,
    TArray< FName >& OutReferencers,
    EAssetRegistryDependencyType::Type ...
)

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

Public function Virtual

increase eng...

 

StripAssetRegistryKeyForObject

(
    FName ObjectPath,
    FName Key
)

Loading then discarding tags is no longer allowed as it can