UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FObjectSaveContextData Struct Reference

#include <ObjectSaveContext.h>

Public Member Functions

COREUOBJECT_API FObjectSaveContextData ()
 
COREUOBJECT_API ~FObjectSaveContextData ()
 
COREUOBJECT_API FObjectSaveContextData (const FObjectSaveContextData &Other)
 
COREUOBJECT_API FObjectSaveContextData (FObjectSaveContextData &&Other)
 
COREUOBJECT_API FObjectSaveContextData (UPackage *Package, const ITargetPlatform *InTargetPlatform, const TCHAR *InTargetFilename, uint32 InSaveFlags)
 
COREUOBJECT_API FObjectSaveContextData (UPackage *Package, const ITargetPlatform *InTargetPlatform, const FPackagePath &TargetPath, uint32 InSaveFlags)
 
COREUOBJECT_API void Set (UPackage *Package, const ITargetPlatform *InTargetPlatform, const TCHAR *InTargetFilename, uint32 InSaveFlags)
 
COREUOBJECT_API void Set (UPackage *Package, const ITargetPlatform *InTargetPlatform, const FPackagePath &TargetPath, uint32 InSaveFlags)
 
void AddSaveOverride (UObject *Target, FObjectSaveOverride InOverride)
 

Public Attributes

FString TargetFilename
 
const ITargetPlatformTargetPlatform = nullptr
 
UE::Cook::ICookInfo * CookInfo = nullptr
 
IPackageWriterPackageWriter = nullptr
 
UObjectObject = nullptr
 
uint32 SaveFlags = 0
 
uint32 OriginalPackageFlags = 0
 
UE::Cook::ECookType CookType = UE::Cook::ECookType::Unknown
 
UE::Cook::ECookingDLC CookingDLC = UE::Cook::ECookingDLC::Unknown
 
EObjectSaveContextPhase ObjectSaveContextPhase = EObjectSaveContextPhase::Invalid
 
bool bProceduralSave = false
 
bool bUpdatingLoadedPath = false
 
bool bOuterConcurrentSave = true
 
bool bSaveSucceeded = true
 
bool bDeterminismDebug = false
 
TMap< UObject *, FObjectSaveOverrideSaveOverrides
 
bool bCleanupRequired = false
 
int32 NumRefPasses = 0
 
bool bBaseClassCalled = false
 
bool bRequestPostSaveSerialization = false
 

Detailed Description

Data used to provide information about the save parameters during PreSave/PostSave.

Constructor & Destructor Documentation

◆ FObjectSaveContextData() [1/5]

PRAGMA_DISABLE_DEPRECATION_WARNINGS FObjectSaveContextData::FObjectSaveContextData ( )
default

◆ ~FObjectSaveContextData()

FObjectSaveContextData::~FObjectSaveContextData ( )
default

◆ FObjectSaveContextData() [2/5]

FObjectSaveContextData::FObjectSaveContextData ( const FObjectSaveContextData Other)
default

◆ FObjectSaveContextData() [3/5]

FObjectSaveContextData::FObjectSaveContextData ( FObjectSaveContextData &&  Other)
default

◆ FObjectSaveContextData() [4/5]

PRAGMA_ENABLE_DEPRECATION_WARNINGS FObjectSaveContextData::FObjectSaveContextData ( UPackage Package,
const ITargetPlatform InTargetPlatform,
const TCHAR InTargetFilename,
uint32  InSaveFlags 
)

Standard constructor; calculates derived fields from the given externally-specified fields.

◆ FObjectSaveContextData() [5/5]

FObjectSaveContextData::FObjectSaveContextData ( UPackage Package,
const ITargetPlatform InTargetPlatform,
const FPackagePath TargetPath,
uint32  InSaveFlags 
)

Member Function Documentation

◆ AddSaveOverride()

void FObjectSaveContextData::AddSaveOverride ( UObject Target,
FObjectSaveOverride  InOverride 
)
inline

Add a save override to specific object. (i.e. mark certain objects or properties transient for this save)

◆ Set() [1/2]

void FObjectSaveContextData::Set ( UPackage Package,
const ITargetPlatform InTargetPlatform,
const FPackagePath TargetPath,
uint32  InSaveFlags 
)

◆ Set() [2/2]

void FObjectSaveContextData::Set ( UPackage Package,
const ITargetPlatform InTargetPlatform,
const TCHAR InTargetFilename,
uint32  InSaveFlags 
)

Set the fields set by the standard constructor.

Member Data Documentation

◆ bBaseClassCalled

bool FObjectSaveContextData::bBaseClassCalled = false

Call-site enforcement; records whether the base PreSave was called.

◆ bCleanupRequired

bool FObjectSaveContextData::bCleanupRequired = false

A bool that can be set from PreSave to indicate PostSave needs to take some extra cleanup steps.

◆ bDeterminismDebug

bool FObjectSaveContextData::bDeterminismDebug = false

Applicable only to cook saves: True if the SavePackage call should write extra debug data for debugging cook determinism or incremental cook issues.

◆ bOuterConcurrentSave

bool FObjectSaveContextData::bOuterConcurrentSave = true

Always true normally. When a system is executing multiple PreSaves/PostSaves concurrently before a single save, all but the first PreSaves have this set to false. If there are PostSaves they are executed in reverse order, and all but the last PostSave have this set to false.

◆ bProceduralSave

bool FObjectSaveContextData::bProceduralSave = false

Set to true when the package is being saved due to a procedural save. Any save without the possibility of user-generated edits to the package is a procedural save (Cooking, EditorDomain). This allows us to execute transforms that only need to be executed in response to new user data.

◆ bRequestPostSaveSerialization

bool FObjectSaveContextData::bRequestPostSaveSerialization = false

Set to true when the current object being serialized needs to call serialize again in PostSave phase.

◆ bSaveSucceeded

bool FObjectSaveContextData::bSaveSucceeded = true

Set to false if the save failed, before calling any PostSaves.

◆ bUpdatingLoadedPath

bool FObjectSaveContextData::bUpdatingLoadedPath = false

Set to true when the LoadedPath of the package being saved is being updated. This allows us to update the in-memory package when it is saved in editor to match its new save file.

◆ CookInfo

UE::Cook::ICookInfo* FObjectSaveContextData::CookInfo = nullptr

The CookInfo providing extended information about the current cook. Null if not cooking.

◆ CookingDLC

UE::Cook::ECookingDLC FObjectSaveContextData::CookingDLC = UE::Cook::ECookingDLC::Unknown

◆ CookType

UE::Cook::ECookType FObjectSaveContextData::CookType = UE::Cook::ECookType::Unknown

◆ NumRefPasses

int32 FObjectSaveContextData::NumRefPasses = 0

PreSave contract enforcement; records whether PreSave is overridden.

◆ Object

UObject* FObjectSaveContextData::Object = nullptr

The object the Save event is being called on, if known.

◆ ObjectSaveContextPhase

EObjectSaveContextPhase FObjectSaveContextData::ObjectSaveContextPhase = EObjectSaveContextPhase::Invalid

Set to the appropriate phase when calling Serialize during SavePackage.

◆ OriginalPackageFlags

uint32 FObjectSaveContextData::OriginalPackageFlags = 0

Package->GetPackageFlags before the save, or 0 if no package.

◆ PackageWriter

IPackageWriter* FObjectSaveContextData::PackageWriter = nullptr

The PackageWriter passed to SavePackage, may be null.

◆ SaveFlags

uint32 FObjectSaveContextData::SaveFlags = 0

The save flags (ESaveFlags) of the save.

◆ SaveOverrides

TMap<UObject*, FObjectSaveOverride> FObjectSaveContextData::SaveOverrides

List of property overrides per object to apply to during save

◆ TargetFilename

FString FObjectSaveContextData::TargetFilename

The target Filename being saved into (not the temporary file for saving). The path is in the standard UnrealEngine form - it is as a relative path from the process binary directory. Set to the empty string if the saved bytes are not being saved to a file.

◆ TargetPlatform

const ITargetPlatform* FObjectSaveContextData::TargetPlatform = nullptr

The target platform of the save, if cooking. Null if not cooking.


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