bHighlightOrigin

bHighlightOrigin

#Overview

name: bHighlightOrigin

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 bHighlightOrigin is to control whether the XYZ axis at the origin should be highlighted on the grid in the Persona viewport, which is part of Unreal Engine’s animation editing system.

This setting variable is primarily used in the Persona module, which is responsible for character animation editing in Unreal Engine. It affects the visualization of the viewport grid and axes in the animation editor.

The value of this variable is set in the Persona options, which are likely configurable through the editor’s preferences or project settings. It can be modified programmatically using the SetHighlightOrigin function in the UPersonaOptions class.

The bHighlightOrigin variable interacts with the DrawHelper’s AxesLineThickness property. When bHighlightOrigin is true, the AxesLineThickness is set to 1.0f, making the origin axes visible. When false, it’s set to 0.0f, effectively hiding the origin axes.

Developers should be aware that this setting affects the visual representation of the 3D space in the animation editor. It can be particularly useful for orienting oneself in the viewport, especially when working with complex animations or character rigs.

Best practices when using this variable include:

  1. Consider enabling it when working on animations that require precise positioning relative to the world origin.
  2. Disable it if the highlighted origin becomes distracting or interferes with other visual elements in the viewport.
  3. Be consistent in its use across a team to maintain a uniform working environment.
  4. Remember that this setting is part of the broader Persona options, so it should be considered alongside other viewport and grid settings for optimal usability.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/Persona/Private/AnimationEditorViewportClient.cpp:116

Scope (from outer to inner):

file
function     FAnimationViewportClient::FAnimationViewportClient

Source code excerpt:

	// DrawHelper set up
	DrawHelper.PerspectiveGridSize = UE_OLD_HALF_WORLD_MAX1;
	DrawHelper.AxesLineThickness = ConfigOption->bHighlightOrigin ? 1.0f : 0.0f;
	DrawHelper.bDrawGrid = true;	// Toggling grid now relies on the show flag

	WidgetMode = UE::Widget::WM_Rotate;
	ModeTools->SetWidgetMode(WidgetMode);

	EngineShowFlags.Game = 0;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Preferences/PersonaOptions.h:125

Scope (from outer to inner):

file
class        class UPersonaOptions : public UObject

Source code excerpt:

	/** Whether or not the XYZ axis at the origin should be highlighted on the grid by default */
	UPROPERTY(EditAnywhere, config, Category = "Viewport")
	uint32 bHighlightOrigin:1;

	/** Whether or not audio should be muted by default for the Animation Editor(s)*/
	UPROPERTY(EditAnywhere, config, Category = "Audio")
	uint32 bMuteAudio:1;

	/** Currently Stats can have None, Basic and Detailed. Please refer to EDisplayInfoMode. */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/PreferenceStubs.cpp:180

Scope (from outer to inner):

file
function     void UPersonaOptions::SetHighlightOrigin

Source code excerpt:

void UPersonaOptions::SetHighlightOrigin( bool bInHighlightOrigin )
{
	bHighlightOrigin = bInHighlightOrigin;
	SaveConfig();
}

void UPersonaOptions::SetViewModeIndex( FName InContext, EViewModeIndex InViewModeIndex, int32 InViewportIndex )
{
	check(InViewportIndex >= 0 && InViewportIndex < 4);