bp.BlamePrintString
bp.BlamePrintString
#Overview
name: bp.BlamePrintString
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When true, prints the Blueprint Asset and Function that generated calls to Print String. Useful for tracking down screen message spam.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bp.BlamePrintString is to enable detailed tracking of Blueprint-generated Print String calls in Unreal Engine. This setting variable is primarily used for debugging and performance optimization in the Blueprint system.
This setting variable is utilized by the Engine module, specifically within the KismetSystemLibrary. It’s part of the Blueprint system and affects how Print String functions behave.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be changed at runtime through the console. It’s initialized to false by default.
The bp.BlamePrintString variable interacts directly with a boolean variable named bBlamePrintString. They share the same value, with bp.BlamePrintString being the console-accessible name and bBlamePrintString being the C++ variable used in the code.
Developers should be aware that enabling this variable will add additional information to Print String outputs, which can be useful for debugging but may impact performance if left enabled in a release build. It’s particularly useful for identifying the source of screen message spam in complex Blueprint setups.
Best practices when using this variable include:
- Enabling it temporarily during development or debugging sessions.
- Disabling it before releasing the game to avoid unnecessary performance overhead.
- Using it in conjunction with other Blueprint debugging tools for comprehensive analysis.
Regarding the associated variable bBlamePrintString:
The purpose of bBlamePrintString is to serve as the in-code representation of the bp.BlamePrintString console variable. It’s used directly in the C++ code to control the behavior of the Print String function.
This boolean variable is used within the UKismetSystemLibrary::PrintString function. When true, it causes the function to include additional information about the Blueprint object and function that generated the Print String call.
The value of bBlamePrintString is set by the FAutoConsoleVariableRef, which links it to the bp.BlamePrintString console variable.
Developers should be aware that this variable is checked every time a Print String function is called from a Blueprint, so frequent changes to its value could potentially impact performance.
Best practices for using bBlamePrintString include:
- Avoiding direct manipulation of this variable in C++ code, instead using the console variable bp.BlamePrintString to change its value.
- Considering the performance impact of enabling this feature in performance-critical sections of the game.
- Using this feature in conjunction with logging systems for more comprehensive debugging information.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp:59
Scope (from outer to inner):
file
namespace UE::Blueprint::Private
Source code excerpt:
bool bBlamePrintString = false;
FAutoConsoleVariableRef CVarBlamePrintString(TEXT("bp.BlamePrintString"),
bBlamePrintString,
TEXT("When true, prints the Blueprint Asset and Function that generated calls to Print String. Useful for tracking down screen message spam."));
void Generic_SetStructurePropertyByName(UObject* OwnerObject, FName StructPropertyName, FStructProperty* SrcStructProperty, const void* SrcStructAddr)
{
if (OwnerObject != nullptr)
#Associated Variable and Callsites
This variable is associated with another variable named bBlamePrintString
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp:58
Scope (from outer to inner):
file
namespace UE::Blueprint::Private
Source code excerpt:
const FName PropertySetFailedWarning = FName("PropertySetFailedWarning");
bool bBlamePrintString = false;
FAutoConsoleVariableRef CVarBlamePrintString(TEXT("bp.BlamePrintString"),
bBlamePrintString,
TEXT("When true, prints the Blueprint Asset and Function that generated calls to Print String. Useful for tracking down screen message spam."));
void Generic_SetStructurePropertyByName(UObject* OwnerObject, FName StructPropertyName, FStructProperty* SrcStructProperty, const void* SrcStructAddr)
{
if (OwnerObject != nullptr)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp:405
Scope (from outer to inner):
file
function void UKismetSystemLibrary::PrintString
Source code excerpt:
#if DO_BLUEPRINT_GUARD
if (UE::Blueprint::Private::bBlamePrintString && !FBlueprintContextTracker::Get().GetCurrentScriptStack().IsEmpty())
{
const TArrayView<const FFrame* const> ScriptStack = FBlueprintContextTracker::Get().GetCurrentScriptStack();
Prefix = FString::Printf(TEXT("Blueprint Object: %s\nBlueprint Function: %s\n%s"),
*ScriptStack.Last()->Node->GetPackage()->GetPathName(),
*ScriptStack.Last()->Node->GetName(),
*Prefix);