DecimalGridSizes

DecimalGridSizes

#Overview

name: DecimalGridSizes

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of DecimalGridSizes is to define a set of grid sizes for translation snapping and grid rendering in the Unreal Engine 5 level editor viewport. This variable is used for decimal-based grid sizes, as opposed to power-of-2 grid sizes.

The Unreal Engine subsystem that primarily relies on this setting variable is the Level Editor, specifically the viewport and transformation tools. It is part of the UnrealEd module, which is responsible for the editor functionality.

The value of this variable is set in the LevelEditorViewportSettings class, which is a UObject-derived class that stores various settings for the level editor viewport. It is marked as an UPROPERTY with the EditAnywhere and config specifiers, meaning it can be edited in the editor and saved to configuration files.

This variable interacts with other variables in the LevelEditorViewportSettings class, such as:

  1. Pow2GridSizes: An alternative array for power-of-2 grid sizes.
  2. bUsePowerOf2SnapSize: A boolean that determines whether to use Pow2GridSizes or DecimalGridSizes.
  3. DecimalGridIntervals: Defines the number of lines between each major line interval for decimal grids.

Developers should be aware that:

  1. The values in DecimalGridSizes affect both the snapping behavior during object translation and the visual representation of the grid in the viewport.
  2. The actual grid size used depends on the bUsePowerOf2SnapSize setting.
  3. Changes to this variable will impact the precision and usability of the level editor’s snapping functionality.

Best practices when using this variable include:

  1. Providing a range of grid sizes that cover both fine and coarse adjustments to suit different level design needs.
  2. Ensuring that the DecimalGridSizes array is populated with sensible values that increase in a logical progression.
  3. Coordinating the values in DecimalGridSizes with those in DecimalGridIntervals to create a coherent grid system.
  4. Consider the typical scale of objects in your game when setting these values to ensure appropriate snapping behavior.
  5. Regularly review and adjust these settings based on level designer feedback to optimize workflow efficiency.

#Setting Variables

#References In INI files

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

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

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

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

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

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

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

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

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

Scope (from outer to inner):

file
class        class ULevelEditorViewportSettings : public UObject

Source code excerpt:

	/** Decimal grid sizes (for translation snapping and grid rendering) */
	UPROPERTY(EditAnywhere, config, AdvancedDisplay, Category=GridSnapping)
	TArray<float> DecimalGridSizes;

	/** The number of lines between each major line interval for decimal grids */
	UPROPERTY(EditAnywhere, config, AdvancedDisplay, Category=GridSnapping)
	TArray<float> DecimalGridIntervals;	

	/** Power of 2 grid sizes (for translation snapping and grid rendering) */

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

Scope (from outer to inner):

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

Source code excerpt:

	return (ViewportSettings->bUsePowerOf2SnapSize) ?
			ViewportSettings->Pow2GridSizes :
			ViewportSettings->DecimalGridSizes;
}

const TArray<float>& UEditorEngine::GetCurrentIntervalGridArray() const
{
	const ULevelEditorViewportSettings* ViewportSettings = GetDefault<ULevelEditorViewportSettings>();

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

Scope (from outer to inner):

file
function     TSharedRef<SWidget> STransformViewportToolBar::FillLocationGridSnapMenu

Source code excerpt:

	const ULevelEditorViewportSettings* ViewportSettings = GetDefault<ULevelEditorViewportSettings>();

	return BuildLocationGridCheckBoxList("Snap", LOCTEXT("LocationSnapText", "Snap Sizes"), ViewportSettings->bUsePowerOf2SnapSize ? ViewportSettings->Pow2GridSizes : ViewportSettings->DecimalGridSizes );
}

TSharedRef<SWidget> STransformViewportToolBar::BuildLocationGridCheckBoxList(FName InExtentionHook, const FText& InHeading, const TArray<float>& InGridSizes) const
{
	const ULevelEditorViewportSettings* ViewportSettings = GetDefault<ULevelEditorViewportSettings>();