BP.bAllowConversionOfComparisonOps

BP.bAllowConversionOfComparisonOps

#Overview

name: BP.bAllowConversionOfComparisonOps

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 BP.bAllowConversionOfComparisonOps is to control whether users can convert between comparison operators on the UK2Node_PromotableOperator in Unreal Engine’s Blueprint system.

This setting variable is primarily used in the Blueprint Graph system, which is part of Unreal Engine’s visual scripting functionality. It’s specifically referenced in the BlueprintGraph module.

The value of this variable is set as a console variable (CVar) with a default value of true. It can be modified at runtime through the console or configuration files.

This variable interacts closely with its associated variable CVarAllowConversionOfComparisonOps. They share the same value and are used interchangeably in the code.

Developers should be aware that this variable affects the flexibility of comparison operators in Blueprints. When set to true, it allows users to convert between different comparison operators, which can be useful for creating more dynamic and adaptable Blueprint logic.

Best practices when using this variable include:

  1. Consider the implications of allowing or disallowing comparison operator conversion in your project’s context.
  2. If you decide to disable this feature, ensure that your existing Blueprints don’t rely on comparison operator conversion.
  3. Document any changes to this setting in your project to maintain consistency across the development team.

Regarding the associated variable CVarAllowConversionOfComparisonOps:

The purpose of CVarAllowConversionOfComparisonOps is identical to BP.bAllowConversionOfComparisonOps. It’s the actual console variable implementation that controls the behavior of comparison operator conversion in the Blueprint system.

This variable is used in the UK2Node_PromotableOperator class, specifically in the GetNodeContextMenuActions function. When the variable is true, it enables the option to convert comparison operators in the node’s context menu.

The value of this variable is set using the TAutoConsoleVariable template, which allows it to be changed at runtime through the console.

Developers should be aware that changes to this variable will immediately affect the behavior of the Blueprint editor, potentially changing the available options in node context menus.

Best practices for using CVarAllowConversionOfComparisonOps include:

  1. Use this variable when you need to programmatically check or modify the comparison operator conversion setting.
  2. Be cautious when changing this value at runtime, as it may affect ongoing Blueprint editing sessions.
  3. Consider exposing this setting in your project’s configuration UI if you want to give users or other developers control over this feature.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/BlueprintGraph/Private/K2Node_PromotableOperator.cpp:46

Scope: file

Source code excerpt:


static TAutoConsoleVariable<bool> CVarAllowConversionOfComparisonOps(
	TEXT("BP.bAllowConversionOfComparisonOps"),
	true,
	TEXT("If true, then allow the user to convert between comparison operators on the UK2Node_PromotableOperator"),
	ECVF_Default);

///////////////////////////////////////////////////////////
// Pin names for default construction

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/BlueprintGraph/Private/K2Node_PromotableOperator.cpp:45

Scope: file

Source code excerpt:

#define LOCTEXT_NAMESPACE "PromotableOperatorNode"

static TAutoConsoleVariable<bool> CVarAllowConversionOfComparisonOps(
	TEXT("BP.bAllowConversionOfComparisonOps"),
	true,
	TEXT("If true, then allow the user to convert between comparison operators on the UK2Node_PromotableOperator"),
	ECVF_Default);

///////////////////////////////////////////////////////////

#Loc: <Workspace>/Engine/Source/Editor/BlueprintGraph/Private/K2Node_PromotableOperator.cpp:145

Scope (from outer to inner):

file
function     void UK2Node_PromotableOperator::GetNodeContextMenuActions

Source code excerpt:

	static const FText PromotableOperatorStr = LOCTEXT("PromotableOperatorNode", "Operator Node");
	
	if (CVarAllowConversionOfComparisonOps.GetValueOnAnyThread() && CanConvertComparisonOperatorNodeType(Context->Node))
	{
		static const FName ConvertComparisonOpName = FName("ConvertComparisonOp");
		static const FText ConvertComparisonOpStr = LOCTEXT("ConvertComparisonOp", "Convert Operator");
		
		FToolMenuSection& Section = Menu->AddSection(ConvertComparisonOpName, ConvertComparisonOpStr);
		for (const FName& PossibleConversionOpName : FTypePromotion::GetComparisonOpNames())