bCanBlueprintsTickByDefault
bCanBlueprintsTickByDefault
#Overview
name: bCanBlueprintsTickByDefault
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bCanBlueprintsTickByDefault is to control whether Blueprint-generated classes can tick by default. This setting is primarily used for the Blueprint system and affects the behavior of Actor and Component classes created in Blueprints.
This setting variable is primarily relied upon by the Blueprint system, specifically the Blueprint compiler (KismetCompiler) and the Blueprint graph system. It’s also referenced in the Engine and EditorEngine modules.
The value of this variable is set in the UEngine constructor (GameEngine.cpp) and can be modified through the Editor’s project settings (as indicated by the UPROPERTY macro in Engine.h).
bCanBlueprintsTickByDefault interacts with other metadata variables, specifically MD_ChildCanTick and MD_ChildCannotTick. These metadata flags can override the behavior set by bCanBlueprintsTickByDefault for specific classes.
Developers must be aware that changing this variable will affect all Blueprints in the project. When modified, it triggers a recompilation of all Blueprints, which can be a time-consuming process for large projects.
Best practices when using this variable include:
- Consider the performance implications of allowing all Blueprints to tick by default.
- Use the MD_ChildCanTick and MD_ChildCannotTick metadata flags to fine-tune ticking behavior for specific classes rather than relying solely on the global setting.
- Be prepared for a potentially lengthy recompilation process when changing this setting in an existing project with many Blueprints.
- Consider the impact on gameplay and logic that relies on ticking behavior before changing this setting.
- Document any changes to this setting and communicate them to the development team, as it can have far-reaching effects on the project.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:281, section: [/Script/Engine.Engine]
- INI Section:
/Script/Engine.Engine
- Raw value:
true
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/BlueprintGraph/Classes/EdGraphSchema_K2.h:104
Scope (from outer to inner):
file
function struct BLUEPRINTGRAPH_API FBlueprintMetadata { public: // Struct/Enum/Class: // If true, this class, struct, or enum is a valid type for use as a variable in a blueprint static const FName MD_Allow
Source code excerpt:
static const FName MD_RestrictedToClasses;
/// [ClassMetadata] Used for Actor and Component classes. If the native class cannot tick, Blueprint generated classes based this Actor or Component can have bCanEverTick flag overridden even if bCanBlueprintsTickByDefault is false.
static const FName MD_ChildCanTick;
/// [ClassMetadata] Used for Actor and Component classes. If the native class cannot tick, Blueprint generated classes based this Actor or Component can never tick even if bCanBlueprintsTickByDefault is true.
static const FName MD_ChildCannotTick;
/// [ClassMetadata] Used to make the first subclass of a class ignore all inherited showCategories and hideCategories commands
static const FName MD_IgnoreCategoryKeywordsInSubclasses;
/** Specifies which struct implements the custom thunk functions for this class */
#Loc: <Workspace>/Engine/Source/Editor/KismetCompiler/Private/KismetCompiler.cpp:5418
Scope (from outer to inner):
file
function void FKismetCompilerContext::SetCanEverTick
Source code excerpt:
const UEngine* EngineSettings = GetDefault<UEngine>();
const bool bAllowTickingByDefault = EngineSettings->bCanBlueprintsTickByDefault;
const UClass* FirstNativeClass = FBlueprintEditorUtils::FindFirstNativeClass(NewClass);
const bool bHasCanTickMetadata = (FirstNativeClass != nullptr) && FirstNativeClass->HasMetaData(FBlueprintMetadata::MD_ChildCanTick);
const bool bHasCannotTickMetadata = (FirstNativeClass != nullptr) && FirstNativeClass->HasMetaData(FBlueprintMetadata::MD_ChildCannotTick);
const bool bHasUniversalParent = (FirstNativeClass != nullptr) && ((AActor::StaticClass() == FirstNativeClass) || (UActorComponent::StaticClass() == FirstNativeClass));
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp:2570
Scope (from outer to inner):
file
function void UEditorEngine::PostEditChangeProperty
Source code excerpt:
FBlueprintCoreDelegates::SetScriptMaximumLoopIterations( MaximumLoopIterationCount );
}
else if (PropertyName == GET_MEMBER_NAME_CHECKED(UEngine, bCanBlueprintsTickByDefault))
{
FScopedSlowTask SlowTask(100, LOCTEXT("DirtyingBlueprintsDueToTickChange", "InvalidatingAllBlueprints"));
// Flag all Blueprints as out of date (this doesn't dirty the package as needs saving but will force a recompile during PIE)
for (TObjectIterator<UBlueprint> BlueprintIt; BlueprintIt; ++BlueprintIt)
{
#Loc: <Workspace>/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectMacros.h:1181
Scope (from outer to inner):
file
namespace UM
Source code excerpt:
BlueprintSpawnableComponent,
/// [ClassMetadata] Used for Actor and Component classes. If the native class cannot tick, Blueprint generated classes based this Actor or Component can have bCanEverTick flag overridden even if bCanBlueprintsTickByDefault is false.
ChildCanTick,
/// [ClassMetadata] Used for Actor and Component classes. If the native class cannot tick, Blueprint generated classes based this Actor or Component can never tick even if bCanBlueprintsTickByDefault is true.
ChildCannotTick,
/// [ClassMetadata] Used for objects with hundreds of nested properties like animation data to stop the editor from hanging to build debug data.
DebugTreeLeaf,
/// [ClassMetadata] Used to make the first subclass of a class ignore all inherited showCategories and hideCategories commands
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/Engine.h:1452
Scope: file
Source code excerpt:
// Blueprints that derive from native C++ classes that have bCanEverTick=true will always be able to tick
// Blueprints that derive from exactly AActor or UActorComponent will always be able to tick
// Otherwise, they can tick as long as the parent doesn't have meta=(ChildCannotTick) and either bCanBlueprintsTickByDefault is true or the parent has meta=(ChildCanTick)
UPROPERTY(EditAnywhere, config, Category=Blueprints)
uint32 bCanBlueprintsTickByDefault:1;
/** Controls whether anim blueprint nodes that access member variables of their class directly should use the optimized path that avoids a thunk to the Blueprint VM. This will force all anim blueprints to be recompiled. */
UPROPERTY(EditAnywhere, config, Category="Anim Blueprints")
uint32 bOptimizeAnimBlueprintMemberVariableAccess:1;
/** Controls whether by default we allow anim blueprint graph updates to be performed on non-game threads. This enables some extra checks in the anim blueprint compiler that will warn when unsafe operations are being attempted. This will force all anim blueprints to be recompiled. */
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/GameEngine.cpp:788
Scope (from outer to inner):
file
function UEngine::UEngine
Source code excerpt:
EndStreamingPauseDelegate = NULL;
bCanBlueprintsTickByDefault = true;
bOptimizeAnimBlueprintMemberVariableAccess = true;
bAllowMultiThreadedAnimationUpdate = true;
bUseFixedFrameRate = false;
FixedFrameRate = 30.f;