VI.ShowTransformGizmo

VI.ShowTransformGizmo

#Overview

name: VI.ShowTransformGizmo

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of VI.ShowTransformGizmo is to control the visibility of the transform gizmo for selected objects in the Unreal Engine viewport. This setting is primarily used in the viewport interaction system and is related to object manipulation and transformation in the editor.

This setting variable is mainly relied upon by the ViewportInteraction subsystem within Unreal Engine’s editor. It’s also utilized by the VirtualProductionUtilities plugin, specifically in the VPUtilitiesEditor module.

The value of this variable is set through various means:

  1. It’s initially defined as a console variable with a default value of 1 (enabled).
  2. It can be modified via console commands.
  3. It’s also set programmatically in the VPUtilitiesEditorModule when settings are modified.
  4. The VPScoutingSubsystem provides a function to set this value, which can be called from Blueprint.

This variable interacts with other editor settings, particularly those related to virtual production and viewport interaction. For example, it’s set alongside other variables like HighSpeedInertiaDamping in the VPUtilitiesEditorModule.

Developers should be aware that this variable directly affects the user experience in the editor. Disabling it will hide the transform gizmo, which might make object manipulation more difficult. It’s also important to note that this setting can be changed both through C++ code and Blueprint, providing flexibility but also requiring careful management to ensure consistency.

Best practices when using this variable include:

  1. Ensuring that changes to this setting are properly communicated to users.
  2. Considering the impact on workflow when enabling or disabling the transform gizmo.
  3. Using the provided functions (like SetShowTransformGizmoCVar) to modify the value rather than directly accessing the console variable, as this ensures proper encapsulation and potential future-proofing.
  4. Being mindful of performance implications, especially in complex scenes where many objects might have visible transform gizmos.

#References in C++ code

#Callsites

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

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

Scope (from outer to inner):

file
namespace    VI

Source code excerpt:

	static FAutoConsoleVariable GizmoHandleHoverScale( TEXT( "VI.GizmoHandleHoverScale" ), 1.5f, TEXT( "How much to scale up transform gizmo handles when hovered over" ) );
	static FAutoConsoleVariable GizmoHandleHoverAnimationDuration( TEXT( "VI.GizmoHandleHoverAnimationDuration" ), 0.1f, TEXT( "How quickly to animate gizmo handle hover state" ) );
	static FAutoConsoleVariable ShowTransformGizmo( TEXT( "VI.ShowTransformGizmo" ), 1, TEXT( "Whether the transform gizmo should be shown for selected objects" ) );
	static FAutoConsoleVariable DragTranslationVelocityStopEpsilon( TEXT( "VI.DragTranslationVelocityStopEpsilon" ), KINDA_SMALL_NUMBER, TEXT( "When dragging inertia falls below this value (cm/frame), we'll stop inertia and finalize the drag" ) );
	static FAutoConsoleVariable SnapGridSize( TEXT( "VI.SnapGridSize" ), 3.0f, TEXT( "How big the snap grid should be.  At 1.0, this will be the maximum of the gizmo's bounding box and a multiple of the current grid snap size" ) );
	static FAutoConsoleVariable SnapGridLineWidth( TEXT( "VI.SnapGridLineWidth" ), 3.0f, TEXT( "Width of the grid lines on the snap grid" ) );
	static FAutoConsoleVariable MinVelocityForInertia( TEXT( "VI.MinVelocityForInertia" ), 1.0f, TEXT( "Minimum velocity (in cm/frame in unscaled room space) before inertia will kick in when releasing objects (or the world)" ) );
	static FAutoConsoleVariable GridHapticFeedbackStrength( TEXT( "VI.GridHapticFeedbackStrength" ), 0.4f, TEXT( "Default strength for haptic feedback when moving across grid points" ) );
	static FAutoConsoleVariable ActorSnap(TEXT("VI.ActorSnap"), 0, TEXT("Whether or not to snap to Actors in the scene. Off by default, set to 1 to enable."));

#Loc: <Workspace>/Engine/Plugins/Experimental/VirtualProductionUtilities/Source/VPUtilitiesEditor/Private/VPScoutingSubsystem.cpp:312

Scope (from outer to inner):

file
function     void UVPScoutingSubsystem::SetShowTransformGizmoCVar

Source code excerpt:

void UVPScoutingSubsystem::SetShowTransformGizmoCVar(const bool bInShowTransformGizmoCVar)
{
	IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("VI.ShowTransformGizmo"));
	CVar->Set(bInShowTransformGizmoCVar);
}

float UVPScoutingSubsystem::GetFlightSpeed()
{
	return GetDefault<UVPUtilitiesEditorSettings>()->FlightSpeed;

#Loc: <Workspace>/Engine/Plugins/Experimental/VirtualProductionUtilities/Source/VPUtilitiesEditor/Private/VPUtilitiesEditorModule.cpp:209

Scope (from outer to inner):

file
function     bool FVPUtilitiesEditorModule::OnSettingsModified

Source code excerpt:

	}

	IConsoleVariable* GizmoCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("VI.ShowTransformGizmo"));
	GizmoCVar->Set(Settings->bUseTransformGizmo);

	IConsoleVariable* InertiaCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("VI.HighSpeedInertiaDamping"));
	InertiaCVar->Set(Settings->bUseGripInertiaDamping ? Settings->InertiaDamping : 0);
	return true;
}

#Loc: <Workspace>/Engine/Plugins/Experimental/VirtualProductionUtilities/Source/VPUtilitiesEditor/Public/VPScoutingSubsystem.h:170

Scope (from outer to inner):

file
class        class UVPScoutingSubsystem : public UEditorSubsystem

Source code excerpt:

	static void SetIsUsingTransformGizmo(const bool bInIsUsingTransformGizmo);

	/** Set value of cvar "VI.ShowTransformGizmo" */
	UFUNCTION(BlueprintCallable, Category = "Virtual Production")
	static void SetShowTransformGizmoCVar(const bool bInShowTransformGizmoCVar);

	/** Get flight speed for scouting in VR */
	UFUNCTION(BlueprintPure, Category = "Virtual Production")
	static float GetFlightSpeed();