bClickBSPSelectsBrush

bClickBSPSelectsBrush

#Overview

name: bClickBSPSelectsBrush

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 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bClickBSPSelectsBrush is to control the interaction behavior when clicking on Binary Space Partitioning (BSP) surfaces in the Unreal Engine 5 Level Editor viewport. It determines whether clicking on a BSP surface selects the brush or the surface itself.

This setting variable is primarily used by the Unreal Editor’s level editing and viewport interaction systems. Based on the callsites, it’s part of the UnrealEd module, specifically within the LevelEditorViewportSettings class and the LevelViewportClickHandlers namespace.

The value of this variable is set in the LevelEditorViewportSettings class, which is likely configurable through the Editor Preferences or Project Settings interface. It’s defined as a bit field within a uint32, indicating it’s a boolean flag.

This variable interacts with input handling logic, particularly when dealing with ctrl+shift+click actions on BSP surfaces. It affects the selection behavior in the level editor viewport.

Developers must be aware that:

  1. When true, clicking a BSP selects the brush, while ctrl+shift+click selects the surface.
  2. When false, the behavior is reversed: clicking selects the surface, while ctrl+shift+click selects the brush.

Best practices when using this variable include:

  1. Consider the team’s preferred workflow when setting this option.
  2. Ensure all team members are aware of the current setting to avoid confusion during level editing.
  3. Document the chosen setting in the project guidelines to maintain consistency across the development team.
  4. Be cautious when changing this setting mid-project, as it may affect established workflows.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:329, section: [/Script/UnrealEd.LevelEditorViewportSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/LevelEditorViewportSettings.h:315

Scope (from outer to inner):

file
class        class ULevelEditorViewportSettings : public UObject

Source code excerpt:

	/** If true, Clicking a BSP selects the brush and ctrl+shift+click selects the surface. If false, vice versa */
	UPROPERTY(EditAnywhere, config, Category=LookAndFeel, meta=( DisplayName = "Clicking BSP Enables Brush" ), AdvancedDisplay)
	uint32 bClickBSPSelectsBrush:1;

	/** If true, viewport will show actor editor context (current level, current data layer(s), current folder) */
	UPROPERTY(EditAnywhere, config, Category = LookAndFeel, meta=(AdvancedDisplay))
	uint32 bShowActorEditorContext : 1;

	/** If true, the Edit widget of a transform will display the axis */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/LevelViewportClickHandlers.cpp:583

Scope (from outer to inner):

file
namespace    LevelViewportClickHandlers
function     void ClickSurface

Source code excerpt:

		{

			if( !GetDefault<ULevelEditorViewportSettings>()->bClickBSPSelectsBrush )
			{
				// Add to the actor selection set the brush actor that belongs to this BSP surface.
				// Check Surf.Actor, as it can be NULL after deleting brushes and before rebuilding BSP.
				if( Surf.Actor )
				{
					const FScopedTransaction Transaction( NSLOCTEXT("UnrealEd", "SelectBrushFromSurface", "Select Brush from Surface") );

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/LevelViewportClickHandlers.cpp:784

Scope: file

Source code excerpt:

			// We are going to handle the notification ourselves
			const bool bNotify = false;
			if(GetDefault<ULevelEditorViewportSettings>()->bClickBSPSelectsBrush)
			{
				// Add to the actor selection set the brush actor that belongs to this BSP surface.
				// Check Surf.Actor, as it can be NULL after deleting brushes and before rebuilding BSP.
				if(Surf.Actor)
				{
					if(!Click.IsControlDown())