bHighlightWithBrackets

bHighlightWithBrackets

#Overview

name: bHighlightWithBrackets

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

#Summary

#Usage in the C++ source code

The purpose of bHighlightWithBrackets is to control how selected objects are visually highlighted in the Unreal Engine editor viewport. Specifically, it determines whether selected objects should be highlighted using brackets in all modes instead of using a special highlight color.

This setting variable is primarily used in the Unreal Engine’s editor subsystem, particularly in the viewport rendering and selection visualization components. It is part of the UnrealEd module, which is responsible for the editor functionality.

The value of this variable is set in the LevelEditorViewportSettings class, which is a UObject-derived class that stores various editor viewport settings. It is defined as a UPROPERTY with the EditAnywhere and config specifiers, meaning it can be edited in the editor’s project settings and is saved to a configuration file.

bHighlightWithBrackets interacts with other variables and systems:

  1. It affects how GEngine sets the selected material color.
  2. It is used in conjunction with the SelectionColor from UEditorStyleSettings.
  3. It influences the behavior of the FEditorModeTools::DrawBrackets function.

Developers should be aware that:

  1. Changing this variable will immediately affect the visual appearance of selected objects in the editor viewport.
  2. It can impact the readability and visibility of selected objects, especially in complex scenes.
  3. The setting is global and affects all viewports.

Best practices when using this variable include:

  1. Consider the overall visual style and clarity of your editor when deciding whether to use brackets or color highlighting.
  2. Be consistent in its usage across projects to maintain a uniform editing experience for your team.
  3. Test the setting with various types of objects and in different lighting conditions to ensure optimal visibility.
  4. Remember that this setting can be particularly useful in situations where color-based selection might be difficult to see, such as when working with brightly colored or highly reflective objects.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:438, 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:505

Scope (from outer to inner):

file
class        class ULevelEditorViewportSettings : public UObject

Source code excerpt:

	/** If enabled, selected objects will be highlighted with brackets in all modes rather than a special highlight color. */
	UPROPERTY(EditAnywhere, config, Category=LookAndFeel, AdvancedDisplay, meta=(DisplayName = "Highlight Selected Objects with Brackets"))
	uint32 bHighlightWithBrackets:1;

	/** If checked all orthographic view ports are linked to the same position and move together. */
	UPROPERTY(EditAnywhere, config, Category=LookAndFeel, meta=(DisplayName = "Link Orthographic Viewport Movement"))
	uint32 bUseLinkedOrthographicViewports:1;

	/** True if viewport box selection requires objects to be fully encompassed by the selection box to be selected */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorEngine.cpp:859

Scope (from outer to inner):

file
function     void UEditorEngine::InitEditor

Source code excerpt:


	// Needs to be set early as materials can be cached with selected material color baked in
	GEngine->SetSelectedMaterialColor(ViewportSettings->bHighlightWithBrackets ? FLinearColor::Black : StyleSettings->SelectionColor);
	GEngine->SetSelectionOutlineColor(StyleSettings->SelectionColor);
	GEngine->SetSubduedSelectionOutlineColor(StyleSettings->GetSubduedSelectionColor());
	GEngine->SelectionHighlightIntensity = ViewportSettings->SelectionHighlightIntensity;
	GEngine->BSPSelectionHighlightIntensity = ViewportSettings->BSPSelectionHighlightIntensity;

	// Set navigation system property indicating whether navigation is supposed to rebuild automatically 

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorModeManager.cpp:608

Scope (from outer to inner):

file
function     void FEditorModeTools::DrawBrackets

Source code excerpt:

void FEditorModeTools::DrawBrackets(FEditorViewportClient* ViewportClient, FViewport* Viewport, const FSceneView* View, FCanvas* Canvas)
{
	if (!ViewportClient->IsPerspective() || !GetDefault<ULevelEditorViewportSettings>()->bHighlightWithBrackets)
	{
		return;
	}

	if (UTypedElementSelectionSet* CurrentSelection = GetEditorSelectionSet())
	{

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:983

Scope (from outer to inner):

file
function     void ULevelEditorViewportSettings::PostEditChangeProperty

Source code excerpt:

		}
	}
	else if (Name == GET_MEMBER_NAME_CHECKED(ULevelEditorViewportSettings, bHighlightWithBrackets))
	{
		GEngine->SetSelectedMaterialColor(bHighlightWithBrackets
			? FLinearColor::Black
			: GetDefault<UEditorStyleSettings>()->SelectionColor);
	}
	else if (Name == GET_MEMBER_NAME_CHECKED(ULevelEditorViewportSettings, SelectionHighlightIntensity))
	{
		GEngine->SelectionHighlightIntensity = SelectionHighlightIntensity;