linker.EnableFullBlueprintPreloading

linker.EnableFullBlueprintPreloading

#Overview

name: linker.EnableFullBlueprintPreloading

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of linker.EnableFullBlueprintPreloading is to control the behavior of Blueprint class regeneration in Unreal Engine 5. Specifically, it determines whether a complete preload of all dependencies should be performed during the Blueprint class regeneration process.

This setting variable is primarily used in the CoreUObject module, which is a fundamental part of Unreal Engine’s object system. It’s particularly relevant to the Blueprint system and class loading mechanism.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of true, meaning that by default, full Blueprint preloading is enabled.

The associated variable CVarEnableFullBlueprintPreloading is directly linked to linker.EnableFullBlueprintPreloading. It’s implemented as a TAutoConsoleVariable, which allows it to be changed at runtime through console commands.

Developers should be aware that this variable can significantly impact Blueprint class regeneration performance and behavior. When enabled (set to true), it ensures a more thorough preloading process, which can be beneficial for catching dependency issues early but may increase load times.

Best practices when using this variable include:

  1. Keep it enabled (default) for development and debugging to ensure all dependencies are properly loaded.
  2. Consider disabling it in shipping builds if load time is a critical factor and you’re confident all dependencies are correctly managed.
  3. Use it in conjunction with profiling tools to understand its impact on your specific project’s load times and memory usage.

Regarding the associated variable CVarEnableFullBlueprintPreloading:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/CoreUObject/Private/Blueprint/BlueprintSupport.cpp:50

Scope: file

Source code excerpt:


static TAutoConsoleVariable<bool> CVarEnableFullBlueprintPreloading(
	TEXT("linker.EnableFullBlueprintPreloading"),
	true,
	TEXT("If true, Blueprint class regeneration will perform a complete preload of all dependencies.")
);

/**
 * Defined in BlueprintSupport.cpp

#Associated Variable and Callsites

This variable is associated with another variable named CVarEnableFullBlueprintPreloading. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/CoreUObject/Private/Blueprint/BlueprintSupport.cpp:49

Scope: file

Source code excerpt:

const FName FBlueprintTags::BlueprintPathWithinPackage(TEXT("BlueprintPath"));

static TAutoConsoleVariable<bool> CVarEnableFullBlueprintPreloading(
	TEXT("linker.EnableFullBlueprintPreloading"),
	true,
	TEXT("If true, Blueprint class regeneration will perform a complete preload of all dependencies.")
);

/**

#Loc: <Workspace>/Engine/Source/Runtime/CoreUObject/Private/Blueprint/BlueprintSupport.cpp:699

Scope (from outer to inner):

file
function     bool FLinkerLoad::RegenerateBlueprintClass

Source code excerpt:

	check(ClassSourceObject);

	if (CVarEnableFullBlueprintPreloading.GetValueOnAnyThread())
	{
		// "Re-preload" cyclic dependencies.
		// 
		// Some known objects, specifically UMetadata and UBlueprint, have a cyclic relationship with the current class.
		// When these objects preload a UClass, they may not have finished preloading their remaining fields.
		// In these cases, we need to effectively "re-preload" them to ensure that they actually complete the preload step.