modeling.Selection.FullHoverHighlights

modeling.Selection.FullHoverHighlights

#Overview

name: modeling.Selection.FullHoverHighlights

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 modeling.Selection.FullHoverHighlights is to control the display of hover highlights in the geometry selection system within Unreal Engine 5’s modeling tools. It determines whether to use full selection hover highlights or simplified highlights when interacting with geometry in the modeling environment.

This setting variable is primarily used in the Mesh Modeling Toolset plugin, specifically within the ModelingComponents module. The GeometrySelectionManager class relies on this variable to decide how to render hover highlights during geometry selection operations.

The value of this variable is set through a console variable (CVar) system. It is defined as a TAutoConsoleVariable with an initial value of 0, which means simplified highlights are used by default. Developers can change this value at runtime through console commands or programmatically.

The associated variable CVarGeometrySelectionManager_FullSelectionHoverHighlights directly interacts with modeling.Selection.FullHoverHighlights. They share the same value and purpose.

Developers must be aware that changing this variable will affect the visual feedback during geometry selection operations. Setting it to 1 will enable full hover highlights, which may provide more detailed visual feedback but could potentially impact performance, especially with complex geometry.

Best practices when using this variable include:

  1. Consider the performance implications of using full hover highlights, especially for large or complex scenes.
  2. Use full highlights (value 1) when precision in selection feedback is crucial.
  3. Stick to simplified highlights (value 0) for better performance in most cases.
  4. Test both modes to determine which works best for your specific use case and target hardware.

Regarding the associated variable CVarGeometrySelectionManager_FullSelectionHoverHighlights:

This is the actual console variable that controls the behavior described above. It is used in the GeometrySelectionManager class to determine whether to use simplified or full hover highlights. The variable is checked in the RebuildPreviewRenderCache function to decide how to accumulate selection elements for rendering.

Developers should be aware that this variable is accessed using the GetValueOnGameThread() method, which suggests that changes to this value are expected to be made on the game thread for thread-safety reasons.

When working with this variable, developers should ensure that any modifications are made in a thread-safe manner and consider the potential impact on the user experience and performance when toggling between simplified and full hover highlights.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Private/Selection/GeometrySelectionManager.cpp:16

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarGeometrySelectionManager_FullSelectionHoverHighlights(
	TEXT("modeling.Selection.FullHoverHighlights"),
	0,
	TEXT("Use full selection hover highlights instead of simplified highlights")
);

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Private/Selection/GeometrySelectionManager.cpp:15

Scope: file

Source code excerpt:

#include UE_INLINE_GENERATED_CPP_BY_NAME(GeometrySelectionManager)

static TAutoConsoleVariable<int32> CVarGeometrySelectionManager_FullSelectionHoverHighlights(
	TEXT("modeling.Selection.FullHoverHighlights"),
	0,
	TEXT("Use full selection hover highlights instead of simplified highlights")
);

#Loc: <Workspace>/Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponents/Private/Selection/GeometrySelectionManager.cpp:1429

Scope (from outer to inner):

file
function     void UGeometrySelectionManager::RebuildPreviewRenderCache

Source code excerpt:

	}

	const bool bUseSimplifiedPreviewHighlight = (CVarGeometrySelectionManager_FullSelectionHoverHighlights.GetValueOnGameThread() == 0);
	const TSharedPtr<FGeometrySelectionTarget> Target = ActiveTargetReferences[0];
	
	if (ActivePreviewSelection.IsEmpty() == false)
	{
		Target->Selector->AccumulateSelectionElements(ActivePreviewSelection, CachedPreviewRenderElements, true, bUseSimplifiedPreviewHighlight);
	}