FAssetData

A struct to hold important information about an assets found by the Asset Registry This struct is transient and should never be serialized

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/AssetRegistry/AssetData.h

Include

#include "AssetRegistry/AssetData.h"

Syntax

struct FAssetData

Remarks

A struct to hold important information about an assets found by the Asset Registry This struct is transient and should never be serialized

Variables

Name Description

Public variable

FTopLevelAssetP...

 

AssetClassPath

The path of the asset's class, e.g. /Script/Engine.StaticMesh

Public variable

FName

 

AssetName

The name of the asset without the package

Public variable

uint32

 

PackageFlags

Asset package flags

Public variable

FName

 

PackageName

The name of the package in which the asset is found, this is the full long package name such as /Game/Path/Package

Public variable

FName

 

PackagePath

The path to the package in which the asset is found, this is /Game/Path with the Package stripped off

Public variable

TSharedPtr< FAs...

 

TaggedAssetBundles

The 'AssetBundles' tag key is separated from TagsAndValues and typed for performance reasons.

Public variable

FAssetDataTagMa...

 

TagsAndValues

The map of values for properties that were marked AssetRegistrySearchable or added by GetAssetRegistryTags

Constructors

Name Description

Public function

FAssetData()

Default constructors.

Public function

FAssetData

(
    FAssetData&&
)

Public function

FAssetData

(
    const FAssetData&
)

Public function

FAssetData

(
    const UObject* InAsset,
    FAssetData::ECreationFlags InCreati...
)

Constructor taking a UObject.

Public function

FAssetData

(
    const UObject* InAsset,
    bool bAllowBlueprintClass
)

Constructor taking a UObject.

Public function

FAssetData

(
    const FString& InLongPackageName,
    const FString& InObjectPath,
    FName InAssetClassName,
    FAssetDataTagMap InTags,
    TArrayView< const int32 > InChunkID...,
    uint32 InPackageFlags
)

Class names are now represented by path names. Please use a version of FAssetData constructor that uses FTopLevelAssetPath.

Public function

FAssetData

(
    const FString& InLongPackageName,
    const FString& InObjectPath,
    FTopLevelAssetPath InAssetClassPath...,
    FAssetDataTagMap InTags,
    TArrayView< const int32 > InChunkID...,
    uint32 InPackageFlags
)

Constructor with a long package name and a full object path which might not be part of the package this asset is in.

Public function

FAssetData

(
    FName InPackageName,
    FName InPackagePath,
    FName InAssetName,
    FName InAssetClassName,
    FAssetDataTagMap InTags,
    TArrayView< const int32 > InChunkID...,
    uint32 InPackageFlags
)

Class names are now represented by path names. Please use a version of FAssetData constructor that uses FTopLevelAssetPath.

Public function

FAssetData

(
    FName InPackageName,
    FName InPackagePath,
    FName InAssetName,
    FTopLevelAssetPath InAssetClassPath...,
    FAssetDataTagMap InTags,
    TArrayView< const int32 > InChunkID...,
    uint32 InPackageFlags
)

Constructor building the ObjectPath in the form of InPackageName.InAssetName.

Functions

Name Description

Public function

void

 

AddChunkID

(
    int32 ChunkID
)

Public function Const

void

 

AppendObjectPath

(
    FString& String
)

Append the object path to the given string.

Public function Const

void

 

AppendObjectPath

(
    FStringBuilderBase& Builder
)

Append the object path to the given string builder.

Public function

void

 

ClearChunkIDs()

Public function Const

void

 

EnumerateTags

(
    Func Fn
)

Call the given function for each tag on the asset.

Public function Const

UObject *...

 

FastGetAsset

(
    bool bLoad,
    TSet< FName > LoadTags
)

Returns the asset UObject if it is loaded or loads the asset if it is unloaded then returns the result

Public function Const

bool

 

FindTag

(
    const FName InTagName
)

Try to find the given tag

Public function Const

UObject *...

 

GetAsset

(
    TSet< FName > LoadTags
)

Returns the asset UObject if it is loaded or loads the asset if it is unloaded then returns the result

Public function Static

SIZE_T

 

GetChunkArrayRegistryAllocatedSize()

Returns overhead of the chunk array registry that's used to manage chunk ID arrays.

Public function Const

FChunkArrayV...

 

GetChunkIDs()

Public function Const

UClass *

 

GetClass

(
    EResolveClass ResolveClass
)

Returns the class UClass if it is loaded.

Public function Static

const TCHAR ...

 

GetCollectionTagPrefix()

The prefix used for collection entries inside TagsAndValues

Public function Const

void

 

GetExportTextName

(
    FStringBuilderBase& OutExportTextN...
)

Populates OutExportTextNameBuilder with the name for the asset in the form: Class'FullPath'

Public function Const

void

 

GetExportTextName

(
    FString& OutExportTextName
)

Populates OutExportTextName with the name for the asset in the form: Class'FullPath'

Public function Const

FString

 

GetExportTextName()

Returns the name for the asset in the form: Class'FullPath'

Public function Static

T *

 

GetFirstAsset

(
    const TArray< FAssetData >& Assets
)

Convenience template for finding first asset of a class

Public function Static

FAssetData

 

GetFirstAssetDataOfClass

(
    const TArray< FAssetData >& Assets,
    const UClass* DesiredClass
)

Get the first FAssetData of a particular class from an Array of FAssetData

Public function Const

void

 

GetFullName

(
    FString& OutFullName
)

Populates OutFullName with the full name for the asset in the form: Class FullPath

Public function Const

void

 

GetFullName

(
    FStringBuilderBase& OutFullNameBui...
)

Populates OutFullNameBuilder with the full name for the asset in the form: Class ObjectPath

Public function Const

FString

 

GetFullName()

Returns the full name for the asset in the form: Class FullPath

Public function Const

FString

 

GetObjectPathString()

Return the object path as a string.

Public function Const

FName

 

GetOptionalOuterPathName()

Public function Const

UPackage ...

 

GetPackage()

Tries to find the package in memory if it is loaded, otherwise loads it.

Public function Const

FPrimaryAsse...

 

GetPrimaryAssetId()

Gets primary asset id of this data

Public function Const

FSoftObjectP...

 

GetSoftObjectPath()

Convert to a SoftObjectPath.

Public function Const

bool

 

GetTagValue

(
    FName Tag,
    FName& OutValue
)

Public function Const

bool

 

GetTagValue

(
    FName Tag,
    FText& OutValue
)

Public function Const

bool

 

GetTagValue

(
    FName Tag,
    FString& OutValue
)

Public function Const

bool

 

GetTagValue

(
    FName Tag,
    ValueType& OutValue
)

Try and get the value associated with the given tag as a type converted value

Public function Const

FAssetRegist...

 

GetTagValueRef

(
    FName Tag
)

Public function Const

FName

 

GetTagValueRef

(
    FName Tag
)

Public function Const

FText

 

GetTagValueRef

(
    FName Tag
)

Public function Const

FString

 

GetTagValueRef

(
    FName Tag
)

Public function Const

ValueType

 

GetTagValueRef

(
    const FName Tag
)

Try and get the value associated with the given tag as a type converted value, or an empty value if it doesn't exist

Public function Const

bool

 

HasAllPackageFlags

(
    uint32 FlagsToCheck
)

Used to check whether all of the passed flags are set in the cached asset package flags.

Public function Const

bool

 

HasAnyPackageFlags

(
    uint32 FlagsToCheck
)

Used to check whether the any of the passed flags are set in the cached asset package flags.

Public function Const

bool

 

HasSameChunkIDs

(
    const FAssetData& OtherAssetData
)

Public function Const

bool

 

IsAssetLoaded()

Returns true if the asset is loaded

Public function Const

bool

 

IsInstanceOf

(
    const UClass* BaseClass,
    EResolveClass ResolveClass
)

Returns whether the Asset's class is equal to or a child class of the given class.

Public function Const

bool

 

IsInstanceOf

(
    EResolveClass ResolveClass
)

Public function Const

bool

 

IsRedirector()

Returns true if the this asset is a redirector.

Public function Static

bool

 

IsRedirector

(
    UObject* Object
)

Public function Static

bool

 

IsTopLevelAsset

(
    UObject* Object
)

Returns true iff the given Object, assumed to be an Asset, is a TopLevelAsset (not a subobject, its outer is a UPackage).

Public function Const

bool

 

IsTopLevelAsset()

Returns true iff the Asset is a TopLevelAsset (not a subobject, its outer is a UPackage).

Public function Static

bool

 

IsUAsset

(
    UObject* Object
)

Returns true if the given UObject is the main asset in a package, true for maps and assets but false for secondary objects like class redirectors Every UAsset is also a TopLevelAsset.

Public function Const

bool

 

IsUAsset()

Returns true if this is the main asset in a package, true for maps and assets but false for secondary objects like class redirectors Every UAsset is also a TopLevelAsset.

Public function Const

bool

 

IsValid()

Checks to see if this AssetData refers to an asset or is NULL

Public function Const

void

 

NetworkWrite

(
    FCbWriter& Writer,
    bool bWritePackageName
)

Note: these functions should only be used for live communication between processing running the same version of the engine.

Public function Const

void

 

PrintAssetData()

Prints the details of the asset to the log

Public function

void

 

SerializeForCache

(
    Archive&& Ar
)

Serialize as part of the registry cache.

Public function

void

 

SerializeForCacheOldVersion

(
    Archive&& Ar,
    FAssetRegistryVersion::Type Version
)

Serialize as part of the registry cache using legacy paths (versioned)

Public function

void

 

SetChunkIDs

(
    const FChunkArrayView& InChunkIDs
)

Public function

void

 

SetChunkIDs

(
    FChunkArray&& InChunkIDs
)

Public function

void

 

SetOptionalOuterPathName

(
    FName InName
)

Public function

void

 

SetTagsAndAssetBundles

(
    FAssetDataTagMap&& Tags
)

Public function

void

 

Shrink()

Public function Const

FSoftObjectP...

 

ToSoftObjectPath()

TODO: Deprecate in favor of GetSoftObjectPath.

Public function Static

FTopLevelAss...

 

TryConvertShortClassNameToPathName

(
    FName InClassName,
    ELogVerbosity::Type FailureMessageV...
)

Helper function that tries to convert short class name to path name

Public function

bool

 

TryNetworkRead

(
    FCbFieldView Field,
    bool bReadPackageName,
    FName InPackageName
)

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const FAssetData& Other
)

Public function Const

bool

 

operator<

(
    const FAssetData& Other
)

Perform a lexical less-than operation on the PackageName and AssetName that uniquely identify two FAssetData.

Public function

FAssetData &

 

operator=

(
    FAssetData&&
)

Public function

FAssetData &

 

operator=

(
    const FAssetData&
)

Public function Const

bool

 

operator==

(
    const FAssetData& Other
)

FAssetDatas are uniquely identified by PackageName and AssetName.

Public function Const

bool

 

operator>

(
    const FAssetData& Other
)

Perform a lexical greater-than operation on the PackageName and AssetName that uniquely identify two FAssetData.

Enums

Name

Description

Public enum

ECreationFlags

Typedefs

Name

Description

FChunkArray

These are usually very small arrays and we can preallocate two elements for the same cost as one on 64-bit systems.

FChunkArrayView

Deprecated Variables

Name Description

Public variable

FName

 

AssetClass

Class names are now represented by path names. Please use AssetClassPath.

Public variable

TArray< int32, ...

 

ChunkIDs

Use SetChunkIDs/GetChunkIDs/AddChunkID instead.

Public variable

FName

 

ObjectPath

FName asset paths have been deprecated. Use GetSoftObjectPath to get the path this asset will use in memory when loaded or GetObjectPathString() if you were just doing ObjectPath.ToString()

Deprecated Functions

Name Description

Public function

 

FAssetData

(
    FName InPackageName,
    FName InPackagePath,
    FName InAssetName,
    FName InAssetClassName,
    FAssetDataTagMap InTags,
    TArrayView< const int32 > InChunkID...,
    uint32 InPackageFlags
)

Class names are now represented by path names. Please use a version of FAssetData constructor that uses FTopLevelAssetPath.

Public function

 

FAssetData

(
    const FString& InLongPackageName,
    const FString& InObjectPath,
    FName InAssetClassName,
    FAssetDataTagMap InTags,
    TArrayView< const int32 > InChunkID...,
    uint32 InPackageFlags
)

Class names are now represented by path names. Please use a version of FAssetData constructor that uses FTopLevelAssetPath.

Public function Const

FSoftObjectP...

 

ToStringReference()

ToStringReference was renamed to GetSoftObjectPath

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