bEnableViewportHoverFeedback

bEnableViewportHoverFeedback

#Overview

name: bEnableViewportHoverFeedback

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

#Summary

#Usage in the C++ source code

The purpose of bEnableViewportHoverFeedback is to control real-time hover feedback when mousing over objects in editor viewports. This setting variable is primarily used in the Unreal Engine’s editor and viewport system.

Based on the provided callsites, this variable is mainly used in the UnrealEd module, specifically in the LevelEditorViewportSettings and various drag tool implementations (BoxSelect and FrustumSelect). It’s also utilized in the ViewportInteraction module.

The value of this variable is set in the ULevelEditorViewportSettings class, which is likely configurable through the editor’s settings menu. It’s defined as a UPROPERTY with the EditAnywhere and config specifiers, indicating that it can be modified by users and saved in configuration files.

This variable interacts with other viewport-related settings, such as bStrictBoxSelection and bHighlightWithBrackets. It’s often used in conjunction with GEditor checks to ensure the editor is available.

Developers should be aware that this variable affects the performance and visual feedback in the editor viewports. Enabling it may have a slight performance impact, especially in scenes with many objects.

Best practices when using this variable include:

  1. Consider the target audience: Enable it for better usability for less experienced users, but consider disabling it for performance reasons in large, complex scenes.
  2. Use it in combination with other viewport settings for a consistent user experience.
  3. Be mindful of its impact on custom editor tools that interact with viewport selection and hovering.
  4. When developing custom viewport interactions, check this setting to maintain consistency with the rest of the editor’s behavior.

#Setting Variables

#References In INI files

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

Scope (from outer to inner):

file
class        class ULevelEditorViewportSettings : public UObject

Source code excerpt:

	/** Enables real-time hover feedback when mousing over objects in editor view ports */
	UPROPERTY(EditAnywhere, config, Category=LookAndFeel, meta=(DisplayName = "Highlight Objects Under Mouse Cursor"))
	uint32 bEnableViewportHoverFeedback:1;

	/** 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. */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/DragTool_BoxSelect.cpp:105

Scope (from outer to inner):

file
function     void FDragTool_ActorBoxSelect::AddDelta

Source code excerpt:

	EndWk = End;
	
	const bool bUseHoverFeedback = GEditor != NULL && GetDefault<ULevelEditorViewportSettings>()->bEnableViewportHoverFeedback;

	if( bUseHoverFeedback )
	{
		const bool bStrictDragSelection = GetDefault<ULevelEditorViewportSettings>()->bStrictBoxSelection;

		UTypedElementSelectionSet* SelectionSet = GEditor->GetEditorSubsystem<ULevelEditorSubsystem>()->GetSelectionSet();

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/DragTool_FrustumSelect.cpp:63

Scope (from outer to inner):

file
function     void FDragTool_ActorFrustumSelect::AddDelta

Source code excerpt:

	End = EndWk;

	const bool bUseHoverFeedback = GEditor != NULL && GetDefault<ULevelEditorViewportSettings>()->bEnableViewportHoverFeedback;
}

void FDragTool_ActorFrustumSelect::StartDrag(FEditorViewportClient* InViewportClient, const FVector& InStart, const FVector2D& InStartScreen)
{
	FDragTool::StartDrag(InViewportClient, InStart, InStartScreen);

	const bool bUseHoverFeedback = GEditor != NULL && GetDefault<ULevelEditorViewportSettings>()->bEnableViewportHoverFeedback;

	// Remove any active hover objects
	FLevelEditorViewportClient::ClearHoverFromObjects();

	FIntPoint MousePos;
	InViewportClient->Viewport->GetMousePos(MousePos);

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/LevelEditorViewport.cpp:4681

Scope (from outer to inner):

file
function     void FLevelEditorViewportClient::CheckHoveredHitProxy

Source code excerpt:


	// We'll keep track of changes to hovered objects as the cursor moves
	const bool bUseHoverFeedback = GEditor != NULL && GetDefault<ULevelEditorViewportSettings>()->bEnableViewportHoverFeedback;
	TSet< FViewportHoverTarget > NewHoveredObjects;

	// If the cursor is visible over level viewports, then we'll check for new objects to be hovered over
	if( bUseHoverFeedback && HoveredHitProxy )
	{
		// Set mouse hover cue for objects under the cursor

#Loc: <Workspace>/Engine/Source/Editor/ViewportInteraction/Private/ViewportWorldInteraction.cpp:925

Scope (from outer to inner):

file
function     void UViewportWorldInteraction::InteractionTick

Source code excerpt:

		if( DefaultOptionalViewportClient != nullptr )
		{
			const bool bUseEditorSelectionHoverFeedback = GEditor != NULL && GetDefault<ULevelEditorViewportSettings>()->bEnableViewportHoverFeedback;
			if( bUseEditorSelectionHoverFeedback && DefaultOptionalViewportClient->IsLevelEditorClient())
			{
				FLevelEditorViewportClient* LevelEditorViewportClient = static_cast<FLevelEditorViewportClient*>( DefaultOptionalViewportClient );
				LevelEditorViewportClient->UpdateHoveredObjects( HoveredObjects );
			}
		}