CommonRotGridSizes

CommonRotGridSizes

#Overview

name: CommonRotGridSizes

The value of this variable can be defined or overridden in .ini config files. 8 .ini config files referencing this setting variable.

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of CommonRotGridSizes is to provide user-defined grid intervals for rotations in the Unreal Engine 5 editor viewport. This setting variable is part of the editor’s grid snapping system, specifically for rotation operations.

CommonRotGridSizes is primarily used by the Level Editor and various editor plugins that involve viewport manipulation. Based on the callsites, it’s utilized in the following subsystems or modules:

  1. UVEditor plugin
  2. CustomizableObjectEditor plugin
  3. UnrealEd module (core editor functionality)

The value of this variable is set in the ULevelEditorViewportSettings class, which is a configuration class for editor viewport settings. It’s defined as a UPROPERTY with the EditAnywhere and config specifiers, allowing it to be edited in the editor’s project settings and saved to configuration files.

CommonRotGridSizes interacts with other variables, notably:

  1. DivisionsOf360RotGridSizes: Another array of rotation grid sizes, used as an alternative to CommonRotGridSizes.
  2. CurrentRotGridMode: Determines which of the two rotation grid arrays (Common or DivisionsOf360) is currently in use.

Developers should be aware that:

  1. This variable is an array of float values, representing different rotation snap intervals.
  2. It’s used in conjunction with DivisionsOf360RotGridSizes to provide two sets of rotation snap options.
  3. The choice between CommonRotGridSizes and DivisionsOf360RotGridSizes is controlled by the CurrentRotGridMode setting.

Best practices when using this variable include:

  1. Providing a range of useful rotation snap values that cover common use cases in your project.
  2. Ensuring that the values in CommonRotGridSizes complement those in DivisionsOf360RotGridSizes to give users a comprehensive set of rotation snapping options.
  3. Consider the needs of your specific project when customizing these values, as different types of games or applications may benefit from different rotation snap intervals.
  4. Remember that users can edit these values in the project settings, so provide documentation or tooltips to explain the purpose and impact of these settings.

#Setting Variables

#References In INI files

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

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

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

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

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

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

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

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Editor/UVEditor/Source/UVEditor/Private/SUVEditor2DViewportToolBar.cpp:356

Scope (from outer to inner):

file
function     TSharedRef<SWidget> SUVEditor2DViewportToolBar::FillRotationGridSnapMenu

Source code excerpt:

		+ SUniformGridPanel::Slot(0, 0)
		[
			BuildRotationGridCheckBoxList("Common", LOCTEXT("RotationCommonText", "Common"), ViewportSettings->CommonRotGridSizes)
		]

	+ SUniformGridPanel::Slot(1, 0)
		[
			BuildRotationGridCheckBoxList("Div360", LOCTEXT("RotationDivisions360DegreesText", "Divisions of 360\u00b0"), ViewportSettings->DivisionsOf360RotGridSizes)
		];

#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/CustomizableObjectEditor/Private/MuCOE/SCustomizableObjectEditorViewportToolBar.cpp:648

Scope (from outer to inner):

file
function     TSharedRef<SWidget> SCustomizableObjectEditorViewportToolBar::FillRotationGridSnapMenu

Source code excerpt:

		+ SUniformGridPanel::Slot(0, 0)
		[
			BuildRotationGridCheckBoxList("Common", LOCTEXT("RotationCommonText", "Common"), ViewportSettings->CommonRotGridSizes, GridMode_Common)
		]

		+ SUniformGridPanel::Slot(1, 0)
		[
			BuildRotationGridCheckBoxList("Div360", LOCTEXT("RotationDivisions360DegreesText", "Divisions of 360\u00b0"), ViewportSettings->DivisionsOf360RotGridSizes, GridMode_DivisionsOf360)
		];

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/LevelEditorViewportSettings.h:417

Scope (from outer to inner):

file
class        class ULevelEditorViewportSettings : public UObject

Source code excerpt:

	/** User defined grid intervals for rotations */
	UPROPERTY(EditAnywhere, config, AdvancedDisplay, Category=GridSnapping)
	TArray<float> CommonRotGridSizes;

	/** Preset grid intervals for rotations */
	UPROPERTY(EditAnywhere, config, AdvancedDisplay, Category=GridSnapping)
	TArray<float> DivisionsOf360RotGridSizes;

	/** Grid sizes for scaling */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorConstraints.cpp:118

Scope (from outer to inner):

file
function     const TArray<float>& UEditorEngine::GetCurrentRotationGridArray

Source code excerpt:


	return (ViewportSettings->CurrentRotGridMode == GridMode_Common) ?
			ViewportSettings->CommonRotGridSizes :
			ViewportSettings->DivisionsOf360RotGridSizes;
}

float UEditorEngine::GetScaleGridSize()
{
	const ULevelEditorViewportSettings* ViewportSettings = GetDefault<ULevelEditorViewportSettings>();

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/STransformViewportToolbar.cpp:824

Scope (from outer to inner):

file
function     TSharedRef<SWidget> STransformViewportToolBar::FillRotationGridSnapMenu

Source code excerpt:

		+ SUniformGridPanel::Slot(0, 0)
		[
			BuildRotationGridCheckBoxList("Common", LOCTEXT("RotationCommonText", "Common"), ViewportSettings->CommonRotGridSizes, GridMode_Common)
		]

	+ SUniformGridPanel::Slot(1, 0)
		[
			BuildRotationGridCheckBoxList("Div360", LOCTEXT("RotationDivisions360DegreesText", "Divisions of 360\u00b0"), ViewportSettings->DivisionsOf360RotGridSizes, GridMode_DivisionsOf360)
		];