r.Editor.3DSnapFade
r.Editor.3DSnapFade
#Overview
name: r.Editor.3DSnapFade
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Tweak to define the grid rendering in 3D viewports.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Editor.3DSnapFade is to control the opacity of the 3D snap grid rendering in Unreal Engine’s editor viewports. This setting variable is specifically used for tweaking the visual appearance of the grid in 3D viewports.
This setting variable is primarily used in the UnrealEd module, which is part of the Unreal Engine’s editor subsystem. It’s referenced in the EditorComponents.cpp file, which suggests it’s related to editor-specific functionality.
The value of this variable is set as a console variable using TAutoConsoleVariable. It’s initialized with a default value of 0.35f, which can be changed at runtime through the console or configuration files.
The associated variable CVarEditor3DSnapFade interacts directly with r.Editor.3DSnapFade. They share the same value and purpose.
Developers should be aware that this variable affects the visual representation of the 3D snap grid in the editor. Changing its value will impact the visibility and clarity of the grid, which can affect the user experience when working in 3D viewports.
Best practices when using this variable include:
- Adjusting it carefully to maintain a balance between grid visibility and scene clarity.
- Considering user preferences and project requirements when setting this value.
- Testing different values in various lighting conditions to ensure the grid remains visible across different scenarios.
Regarding the associated variable CVarEditor3DSnapFade:
- Its purpose is identical to r.Editor.3DSnapFade, controlling the opacity of the 3D snap grid.
- It’s used in the same UnrealEd module and EditorComponents.cpp file.
- The value is set and accessed using GetValueOnGameThread() method, suggesting it’s safe to use from the game thread.
- It’s used in conjunction with other editor settings like CVarEditor3DGridFade to set vector parameters for material instances used in grid rendering.
- Developers should treat this variable as they would r.Editor.3DSnapFade, as they are essentially the same setting.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorComponents.cpp:43
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarEditor3DSnapFade(
TEXT("r.Editor.3DSnapFade"),
0.35f,
TEXT("Tweak to define the grid rendering in 3D viewports."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarEditor2DSnapMin(
TEXT("r.Editor.2DSnapMin"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarEditor3DSnapFade
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorComponents.cpp:42
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarEditor3DSnapFade(
TEXT("r.Editor.3DSnapFade"),
0.35f,
TEXT("Tweak to define the grid rendering in 3D viewports."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarEditor2DSnapMin(
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorComponents.cpp:188
Scope (from outer to inner):
file
function void FGridWidget::DrawNewGrid
Source code excerpt:
{
MaterialInst->SetVectorParameterValue(GridColorName, FLinearColor(0.6f * Darken, 0.6f * Darken, 0.6f * Darken, CVarEditor3DGridFade.GetValueOnGameThread()));
MaterialInst->SetVectorParameterValue(SnapColorName, FLinearColor(0.5f, 0.0f, 0.0f, SnapAlphaMultiplier * CVarEditor3DSnapFade.GetValueOnGameThread()));
}
else
{
MaterialInst->SetVectorParameterValue(GridColorName, FLinearColor(0.6f * Darken, 0.6f * Darken, 0.6f * Darken, CVarEditor2DGridFade.GetValueOnGameThread()));
MaterialInst->SetVectorParameterValue(SnapColorName, FLinearColor(0.5f, 0.0f, 0.0f, SnapAlphaMultiplier * CVarEditor2DSnapFade.GetValueOnGameThread()));
}