UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Serialization::FEditorBulkData Class Referencefinal

#include <EditorBulkData.h>

Classes

struct  FSharedBufferWithID
 

Public Member Functions

 FEditorBulkData ()=default
 
COREUOBJECT_API ~FEditorBulkData ()
 
COREUOBJECT_API FEditorBulkData (FEditorBulkData &&Other)
 
COREUOBJECT_API FEditorBulkDataoperator= (FEditorBulkData &&Other)
 
COREUOBJECT_API FEditorBulkData (const FEditorBulkData &Other)
 
COREUOBJECT_API FEditorBulkDataoperator= (const FEditorBulkData &Other)
 
COREUOBJECT_API void CreateFromBulkData (FBulkData &BulkData, const FGuid &Guid, UObject *Owner)
 
COREUOBJECT_API void CreateLegacyUniqueIdentifier (UObject *Owner)
 
COREUOBJECT_API void Serialize (FArchive &Ar, UObject *Owner, bool bAllowRegister=true)
 
COREUOBJECT_API void Reset ()
 
COREUOBJECT_API void UnloadData ()
 
COREUOBJECT_API void DetachFromDisk (FArchive *Ar, bool bEnsurePayloadIsLoaded)
 
COREUOBJECT_API FGuid GetIdentifier () const
 
COREUOBJECT_API const FIoHashGetPayloadId () const
 
int64 GetPayloadSize () const
 
bool HasPayloadData () const
 
COREUOBJECT_API bool DoesPayloadNeedLoading () const
 
COREUOBJECT_API TFuture< FSharedBufferGetPayload () const
 
COREUOBJECT_API TFuture< FCompressedBufferGetCompressedPayload () const
 
COREUOBJECT_API void UpdatePayload (FSharedBuffer InPayload, UObject *Owner=nullptr)
 
COREUOBJECT_API void UpdatePayload (FCompressedBuffer InPayload, UObject *Owner=nullptr)
 
COREUOBJECT_API void UpdatePayload (FSharedBufferWithID InPayload, UObject *Owner=nullptr)
 
COREUOBJECT_API void SetCompressionOptions (ECompressionOptions Option)
 
COREUOBJECT_API void SetCompressionOptions (ECompressedBufferCompressor Compressor, ECompressedBufferCompressionLevel CompressionLevel)
 
COREUOBJECT_API FCustomVersionContainer GetCustomVersions (FArchive &InlineArchive)
 
COREUOBJECT_API void GetBulkDataVersions (FArchive &InlineArchive, FPackageFileVersion &OutUEVersion, int32 &OutLicenseeUEVersion, FCustomVersionContainer &OutCustomVersions) const
 
COREUOBJECT_API void TearOff ()
 
FEditorBulkData CopyTornOff () const
 
COREUOBJECT_API void SerializeForRegistry (FArchive &Ar)
 
COREUOBJECT_API bool CanSaveForRegistry () const
 
bool HasPlaceholderPayloadId () const
 
COREUOBJECT_API bool IsMemoryOnlyPayload () const
 
COREUOBJECT_API void UpdatePayloadId ()
 
COREUOBJECT_API bool LocationMatches (const FEditorBulkData &Other) const
 
COREUOBJECT_API void UpdateRegistrationOwner (UObject *Owner)
 
COREUOBJECT_API void SetVirtualizationOptOut (bool bOptOut)
 

Protected Types

enum class  ETornOff
 

Protected Member Functions

COREUOBJECT_API FEditorBulkData (const FEditorBulkData &Other, ETornOff)
 

Friends

struct FTocEntry
 

Detailed Description

The goal of this class is to provide an editor time version of BulkData that will work with the asset virtualization system.

Assuming that the DDC is hot, the virtualized payloads are accessed relatively infrequently, usually when the package is being edited in the editor in some manner. So the payload access is designed around this. If the data is frequently accessed when running the editor then the user would not gain from having it virtualized as they would end up pulling it immediately anyway.

The biggest difference with normal bulkdata is that the access times might be significantly longer if the payload is not readily available which is why the only way to access the payload is by a TFuture or a callback so that the caller is forced to consider how to handle the potential stall and hopefully organize their code in such a way that the time lag is not noticeable to the user.

The second biggest difference is that the caller will own the payload memory once it is returned to them, unlike the old bulkdata class which would retain ownership. Which forces the calling code to be in control of when the memory is actually allocated and for how long. With the old bulkdata class a single access would leave that memory allocated in a non-obvious way and would lead to memory bloats within the editor.

The method ::GetGuid can be used to access a unique identifier for the payload, currently it is based on the payload itself, so that two objects with the same payload would both have the same Guid. The intent is that we would be able to share local copies of the payload between branches to reduce the cost of having multiple branches with similar data on the same machine.

Updating the bulkdata: Unlike the older bulkdata system, EditorBulkData does not support any lock/unlock mechanism, instead the internal data is updated via a single call to UpdatePayload and the data is retrieved via a single call to GetPayload.

For examples see the "System.CoreUObject.Serialization.EditorBulkData.UpdatePayload" test found in Engine\Source\Runtime\CoreUObject\Private\Tests\Serialization\EditorBulkDataTests.cpp.

Thread Safety:

The class should be thread safe in that you can call the public methods on multiple threads at once and expect things to work. However if you were to call GetPayloadSize() before calling GetPayload() on one thread it would be possible for a call to UpdatePayload() to occur on another thread in between those two calls, meaning that the size you got might not be the correct size as the payload returned. If you need that level of thread safety it would be up to you to manage it at a higher level. It would however be safe to pass a copy of your FEditorBulkData to a background task rather than a reference. The copy would either be able to load the payload from disk, pull it from virtualized storage or if the source bulkdata is holding the payload in memory it will just take a reference to that payload rather than making a copy. In this way you can be sure of the state of the FEditorBulkData on the background task as future edits to the original bulkdata will not affect it. The base class with no type

Member Enumeration Documentation

◆ ETornOff

Constructor & Destructor Documentation

◆ FEditorBulkData() [1/4]

UE::Serialization::FEditorBulkData::FEditorBulkData ( )
default

◆ ~FEditorBulkData()

UE::Serialization::FEditorBulkData::~FEditorBulkData ( )

◆ FEditorBulkData() [2/4]

UE::Serialization::FEditorBulkData::FEditorBulkData ( FEditorBulkData &&  Other)

◆ FEditorBulkData() [3/4]

UE::Serialization::FEditorBulkData::FEditorBulkData ( const FEditorBulkData Other)

◆ FEditorBulkData() [4/4]

UE::Serialization::FEditorBulkData::FEditorBulkData ( const FEditorBulkData Other,
ETornOff   
)
protected

Member Function Documentation

◆ CanSaveForRegistry()

bool UE::Serialization::FEditorBulkData::CanSaveForRegistry ( ) const

Return true if the bulkdata has a source location that persists between editor processes (package file or virtualization).

◆ CopyTornOff()

FEditorBulkData UE::Serialization::FEditorBulkData::CopyTornOff ( ) const
inline

Make a torn-off copy of this bulk data.

◆ CreateFromBulkData()

void UE::Serialization::FEditorBulkData::CreateFromBulkData ( FBulkData BulkData,
const FGuid Guid,
UObject Owner 
)

Convenience method to make it easier to convert from FBulkData to FEditorBulkData and sets the Guid

Parameters
BulkDataThe bulkdata object to create from.
GuidA guid associated with the bulkdata object which will be used to identify the payload. This MUST remain the same between sessions so that the payloads key remains consistent!

◆ CreateLegacyUniqueIdentifier()

void UE::Serialization::FEditorBulkData::CreateLegacyUniqueIdentifier ( UObject Owner)

Fix legacy content that created the Id from non-unique Guids. Run on objects created before FUE5MainStreamObjectVersion::VirtualizedBulkDataHaveUniqueGuids

◆ DetachFromDisk()

void UE::Serialization::FEditorBulkData::DetachFromDisk ( FArchive Ar,
bool  bEnsurePayloadIsLoaded 
)

Removes the ability for the bulkdata object to load it's payload from disk (if it was doing so)

Parameters
ArThe archive that the bulkdata is being detached from. This should match AttachedAr.
bEnsurePayloadIsLoadedIf true and the bulkdata currently is storing it's payload as a package on disk then the payload should be loaded into memory so that it can be accessed in the future. If false then the payload is not important and does not need to be loaded.

◆ DoesPayloadNeedLoading()

bool UE::Serialization::FEditorBulkData::DoesPayloadNeedLoading ( ) const

Returns if the payload would require loading in order to be accessed. Returns false if the payload is already in memory or of zero length

◆ GetBulkDataVersions()

void UE::Serialization::FEditorBulkData::GetBulkDataVersions ( FArchive InlineArchive,
FPackageFileVersion OutUEVersion,
int32 OutLicenseeUEVersion,
FCustomVersionContainer OutCustomVersions 
) const

Get the versions used in the file containing the payload.

Parameters
InlineArchiveThe archive that was used to load this object

◆ GetCompressedPayload()

TFuture< FCompressedBuffer > UE::Serialization::FEditorBulkData::GetCompressedPayload ( ) const

Returns an immutable FCompressedBuffer reference to the payload data.

Note that depending on the internal storage formats, the payload might not actually be compressed, but that will be handled by the FCompressedBuffer interface. Call FCompressedBuffer::Decompress() to get access to the payload in FSharedBuffer format.

◆ GetCustomVersions()

FCustomVersionContainer UE::Serialization::FEditorBulkData::GetCustomVersions ( FArchive InlineArchive)

◆ GetIdentifier()

FGuid UE::Serialization::FEditorBulkData::GetIdentifier ( ) const

Returns a unique identifier for the object itself.

◆ GetPayload()

TFuture< FSharedBuffer > UE::Serialization::FEditorBulkData::GetPayload ( ) const

Returns an immutable FCompressedBuffer reference to the payload data.

◆ GetPayloadId()

const FIoHash & UE::Serialization::FEditorBulkData::GetPayloadId ( ) const

Returns an unique identifier for the content of the payload.

◆ GetPayloadSize()

int64 UE::Serialization::FEditorBulkData::GetPayloadSize ( ) const
inline

Returns the size of the payload in bytes.

◆ HasPayloadData()

bool UE::Serialization::FEditorBulkData::HasPayloadData ( ) const
inline

Returns true if the bulkdata object contains a valid payload greater than zero bytes in size.

◆ HasPlaceholderPayloadId()

bool UE::Serialization::FEditorBulkData::HasPlaceholderPayloadId ( ) const
inline

Return whether the BulkData has legacy payload id that needs to be updated from loaded payload before it can be used in DDC.

◆ IsMemoryOnlyPayload()

bool UE::Serialization::FEditorBulkData::IsMemoryOnlyPayload ( ) const

Return whether the BulkData is an in-memory payload without a persistent source location.

◆ LocationMatches()

bool UE::Serialization::FEditorBulkData::LocationMatches ( const FEditorBulkData Other) const

Return whether *this has the same source for the bulkdata (e.g. identical file locations if from file) as Other

◆ operator=() [1/2]

FEditorBulkData & UE::Serialization::FEditorBulkData::operator= ( const FEditorBulkData Other)

◆ operator=() [2/2]

FEditorBulkData & UE::Serialization::FEditorBulkData::operator= ( FEditorBulkData &&  Other)

◆ Reset()

void UE::Serialization::FEditorBulkData::Reset ( )

Reset to a truly empty state

◆ Serialize()

void UE::Serialization::FEditorBulkData::Serialize ( FArchive Ar,
UObject Owner,
bool  bAllowRegister = true 
)

Used to serialize the bulkdata to/from a FArchive

Parameters
ArThe archive to serialize the bulkdata.
OwnerThe UObject that contains the bulkdata object, if this is a nullptr then the bulkdata will assume that it must serialize the payload immediately to memory as it will not be able to identify it's package path.
bAllowRegistryLegacy parameter to skip registration when loading BulkData we know we will need to modify the identifier of. Should always be true for non-legacy serialization.

Beyond this point UpdatedFlags will be modified to avoid serializing some flags

So any code actually using UpdatedFlags should come before this section of code

◆ SerializeForRegistry()

void UE::Serialization::FEditorBulkData::SerializeForRegistry ( FArchive Ar)

Used to serialize the bulkdata to/from a limited cache system used by the BulkDataRegistry.

◆ SetCompressionOptions() [1/2]

void UE::Serialization::FEditorBulkData::SetCompressionOptions ( ECompressedBufferCompressor  Compressor,
ECompressedBufferCompressionLevel  CompressionLevel 
)

Sets the compression options to be applied to the payload during serialization.

These settings will continue to be used until the bulkdata object is reset, a subsequent call to SetCompressionOptions is made or the owning package is serialized to disk.

Parameters
CompressorThe Oodle compressor to use.
See also
ECompressedBufferCompressor
Parameters
CompressionLevelThe Oodle compression level to use.
See also
ECompressedBufferCompressionLevel

◆ SetCompressionOptions() [2/2]

void UE::Serialization::FEditorBulkData::SetCompressionOptions ( ECompressionOptions  Option)

Sets the compression options to be applied to the payload during serialization.

These settings will continue to be used until the bulkdata object is reset, a subsequent call to SetCompressionOptions is made or the owning package is serialized to disk.

Parameters
OptionThe high level option to use.
See also
UE::Serialization::ECompressionOptions

◆ SetVirtualizationOptOut()

COREUOBJECT_API void UE::Serialization::FEditorBulkData::SetVirtualizationOptOut ( bool  bOptOut)

◆ TearOff()

void UE::Serialization::FEditorBulkData::TearOff ( )

Set this BulkData into Torn-Off mode. It will no longer register with the BulkDataRegistry, even if copied from another BulkData, and it will pass on this flag to any BulkData copied/moved from it. Use Reset() to remove this state. Torn-off BulkDatas share the guid with the BulkData they copy from.

◆ UnloadData()

void UE::Serialization::FEditorBulkData::UnloadData ( )

Unloads the data (if possible) but leaves it in a state where the data can be reloaded

◆ UpdatePayload() [1/3]

void UE::Serialization::FEditorBulkData::UpdatePayload ( FCompressedBuffer  InPayload,
UObject Owner = nullptr 
)

Replaces the existing payload (if any) with a new one. Note that FCompressedBuffers already know the FIoHash of the raw payload and so we do not recalculate it, making this method much faster for larger payloads than the other overloads.

Parameters
InPayloadThe payload that this bulkdata object should reference.
See also
FCompressedBuffer
Parameters
OwnerThe object that owns the bulkdata, or null to not associate with a UObject.

◆ UpdatePayload() [2/3]

void UE::Serialization::FEditorBulkData::UpdatePayload ( FSharedBuffer  InPayload,
UObject Owner = nullptr 
)

Replaces the existing payload (if any) with a new one. It is important to consider the ownership model of the payload being passed in to the method.

To pass in a raw pointer use 'FSharedBuffer::...(Data, Size)' to create a valid FSharedBuffer. Use 'FSharedBuffer::MakeView' if you want to retain ownership on the data being passed in, and use 'FSharedBuffer::TakeOwnership' if you are okay with the bulkdata object taking over ownership of it. The bulkdata object must own its internal buffer, so if you pass in a non-owned FSharedBuffer (ie by using 'FSharedBuffer::MakeView') then a clone of the data will be created internally and assigned to the bulkdata object.

Parameters
InPayloadThe payload that this bulkdata object should reference.
See also
FSharedBuffer
Parameters
OwnerThe object that owns the bulkdata, or null to not associate with a UObject.

◆ UpdatePayload() [3/3]

void UE::Serialization::FEditorBulkData::UpdatePayload ( FSharedBufferWithID  InPayload,
UObject Owner = nullptr 
)

Allows the existing payload to be replaced with a new one.

To pass in a raw pointer use 'FSharedBuffer::...(Data, Size)' to create a valid FSharedBuffer. Use 'FSharedBuffer::MakeView' if you want to retain ownership on the data being passed in, and use 'FSharedBuffer::TakeOwnership' if you are okay with the bulkdata object taking over ownership of it. The bulkdata object must own its internal buffer, so if you pass in a non-owned FSharedBuffer (ie by using 'FSharedBuffer::MakeView') then a clone of the data will be created internally and assigned to the bulkdata object.

Use this override if you want compute PayloadId before updating the bulkdata

Parameters
InPayloadThe payload to update the bulkdata with
OwnerThe object that owns the bulkdata, or null to not associate with a UObject.

◆ UpdatePayloadId()

void UE::Serialization::FEditorBulkData::UpdatePayloadId ( )

Load the payload and set the correct payload id, if the bulkdata has a PlaceholderPayloadId.

◆ UpdateRegistrationOwner()

void UE::Serialization::FEditorBulkData::UpdateRegistrationOwner ( UObject Owner)

Update the Owner of this BulkData in the BulkDataRegistry to include the Owner information. Has no effect if the BulkData is not valid for registration. The Owner information is lost and this function must be called again if the BulkData's payload information is modified.

Friends And Related Symbol Documentation

◆ FTocEntry

friend struct FTocEntry
friend

The documentation for this class was generated from the following files: