IAssetRegistry

Windows
MacOS
Linux

References

Module

AssetRegistry

Header

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

Include

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

void

 

ExpandRecursiveFilter

(
    const FARFilter& InFilter,
    FARFilter& ExpandedFilter
)

Modifies passed in filter to make it safe for use on FAssetRegistryState.

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

uint32

 

GetAllocatedSize

(
    bool bLogDetailed
)

Returns memory size of entire registry, optionally logging sizes

Public function Const

bool

 

GetAncestorClassNames

(
    FName ClassName,
    TArray< FName >& OutAncestorClassNames
)

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

Public function Const

EAssetAvailability::Type

 

GetAssetAvailability

(
    const FAssetData& AssetData
)

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

Public function Const

float

 

GetAssetAvailabilityProgress

(
    const FAssetData& AssetData,
    EAssetAvailabilityProgressReportingType::Type ReportType
)

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

const FAssetPackageData *

 

GetAssetPackageData

(
    FName PackageName
)

Finds Package data for a package name.

Public function Const

const FAssetRegistryState *

 

GetAssetRegistryState()

Returns read only reference to the current asset registry state.

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

 

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 >& AssetTagsAndValues,
    TArray< FAssetData >& OutAssetData
)

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

Protected function Const

const FAssetData *

 

GetCachedAssetDataForObjectPath

(
    const FName ObjectPath
)

Returns pointer to cached AssetData for an object path.

Public function Const

const TSet< FName > &

 

GetCachedEmptyPackages()

Returns the set of empty package names fast iteration

Public function Const

bool

 

GetDependencies

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

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

Public function Const

bool

 

GetDependencies

(
    const FAssetIdentifier& AssetIdentifier,
    TArray< FAssetIdentifier >& OutDependencies,
    EAssetRegistryDependencyType::Type InDependencyType
)

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

Public function Const

void

 

GetDerivedClassNames

(
    const TArray< FName >& ClassNames,
    const TSet< FName >& ExcludedClassNames,
    TSet< FName >& OutDerivedClassNames
)

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

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

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

Public function Const

bool

 

GetReferencers

(
    const FAssetIdentifier& AssetIdentifier,
    TArray< FAssetIdentifier >& OutReferencers,
    EAssetRegistryDependencyType::Type InReferenceType
)

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

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

 

HasAssets

(
    const FName PackagePath,
    const bool bRecursive
)

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

Public function Const

void

 

InitializeSerializationOptions

(
    FAssetRegistrySerializationOptions& Options,
    const FString& PlatformIniName
)

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

Public function Const

void

 

InitializeTemporaryAssetRegistryState

(
    FAssetRegistryState& OutState,
    const FAssetRegistrySerializationOptions& Options,
    bool bRefreshExisting,
    const TMap< FName, FAssetData* >& OverrideData
)

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

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 Virtual Const

bool

 

K2_GetDependencies

(
    FName PackageName,
    const FAssetRegistryDependencyOptions& DependencyOptions,
    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 FAssetRegistryDependencyOptions& ReferenceOptions,
    TArray< FName >& OutReferencers
)

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

Public function Const

void

 

LoadPackageRegistryData

(
    FArchive& Ar,
    TArray< FAssetData* >& Data
)

Load FPackageRegistry data from the supplied package

Public function

FAssetAddedEvent &

 

OnAssetAdded()

Public function

FAssetRemovedEvent &

 

OnAssetRemoved()

Public function

FAssetRenamedEvent &

 

OnAssetRenamed()

Public function

FAssetUpdatedEvent &

 

OnAssetUpdated()

Public function

FFileLoadProgressUpdatedEvent &

 

OnFileLoadProgressUpdated()

Public function

FFilesLoadedEvent &

 

OnFilesLoaded()

Public function

FInMemoryAssetCreatedEvent &

 

OnInMemoryAssetCreated()

Public function

FInMemoryAssetDeletedEvent &

 

OnInMemoryAssetDeleted()

Public function

FPathAddedEvent &

 

OnPathAdded()

Public function

FPathRemovedEvent &

 

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

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

bool

 

RemovePath

(
    const FString& PathToRemove
)

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

Public function Const

void

 

RunAssetsThroughFilter

(
    TArray< FAssetData >& AssetDataList,
    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 >& InFilePaths,
    bool bForceRescan
)

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

Public function

void

 

ScanModifiedAssetFiles

(
    const TArray< FString >& InFilePaths
)

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
)

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, FAssetIdentifier >& ManagerMap,
    bool bClearExisting,
    EAssetRegistryDependencyType::Type RecurseType,
    ShouldSetManagerPredicate ShouldSetManager
)

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

 

StripAssetRegistryKeyForObject

(
    FName ObjectPath,
    FName Key
)

Removes a key from the key value pairs for an object

Public function

void

 

Tick

(
    float DeltaTime
)

Tick the asset registry

Public function Const

void

 

UseFilterToExcludeAssets

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

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

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 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 rather to recurse into a reference when setting manager

Deprecated Functions

Name Description

Public function

void

 

LoadRegistryData

(
    FArchive& Ar,
    TMap< FName, FAssetData* >& Data
)

Deprecated. Create a FAssetRegistryState and call Serialize on it directly

Public function

void

 

SaveRegistryData

(
    FArchive& Ar,
    TMap< FName, FAssetData* >& Data,
    TArray< FName >* InMaps
)

Deprecated. Use InitializeTemporaryAssetRegistryState and call Serialize on it directly

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback