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

#include <BlueprintSupport.h>

Static Public Member Functions

static FObjectInitializerDeferObjectInitializerIfNeeded (const FObjectInitializer &DeferringInitializer)
 
static bool DeferObjectPreload (UObject *Object)
 
static void ResolveDeferredInitsFromArchetype (UObject *Archetype)
 

Detailed Description

Access points for making FDeferredInitializationTracker calls. Takes care of routing calls to the right tracker (CDOs vs sub-objects), and wraps the TThreadSingleton access for each.

Member Function Documentation

◆ DeferObjectInitializerIfNeeded()

FObjectInitializer * FDeferredObjInitializationHelper::DeferObjectInitializerIfNeeded ( const FObjectInitializer DeferringInitializer)
static

Determines if the specified initializer needs to be deferred (does it have a archetype dependency that needs to be serialized first?). If so, the FObjectInitializer will be copied and stored with the appropriate tracker (CDO vs. sub-object, etc.).

Designed to be called from the FObjectInitializer itself (before it runs initialization).

Returns
A pointer to the initializer copy (if one was made), null if no deferral was needed.

◆ DeferObjectPreload()

bool FDeferredObjInitializationHelper::DeferObjectPreload ( UObject Object)
static

Determines if the specified object should have its Preload() skipped. If so, this should cache the sub-object so it can be loaded later, when its dependency is resolved.

Designed to be called from the Preload() itself (before it runs serializes the object).

More info: Because of delta serialization, we require that a parent's CDO be fully serialized before its children's CDOs are created. However, due to cyclic parent/child dependencies, we have some cases where the linker breaks that expected behavior. In those cases, we defer the child's initialization (i.e. defer copying of parent property values, etc.), and wait until we can guarantee that the parent CDO has been fully loaded.

In a normal scenario, the order of property initialization is: Creation (zeroed) -> Initialization (copied super's values) -> Serialization (overridden values loaded) When the initialization has been deferred we have to make sure to defer serialization here as well (don't worry, it will be invoked again from FinalizeBlueprint()->ResolveDeferredExports())

also, if this is an inherited sub-object on a CDO, and that CDO has had its initialization deferred (for reasons explained above), then we shouldn't serialize in data for this quite yet... not until its owner has had a chaTnce to initialize itself (because, as part of CDO initialization, inherited sub-objects get filled in with values inherited from the super)

Returns
True if the object's Preload() should be skipped.

◆ ResolveDeferredInitsFromArchetype()

void FDeferredObjInitializationHelper::ResolveDeferredInitsFromArchetype ( UObject Archetype)
static

Loops through all object initializers and preloads that were skipped due to this archetype object not being ready yet.

Should be called once the object has been fully serialized in.


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