modeling.UVEditor.EnableLivePreviewArrangement
modeling.UVEditor.EnableLivePreviewArrangement
#Overview
name: modeling.UVEditor.EnableLivePreviewArrangement
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable auto arranging objects in the UV Editor\'s live viewport when multiple objects are loaded from the Content Browser.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of modeling.UVEditor.EnableLivePreviewArrangement is to control the automatic arrangement of objects in the UV Editor’s live viewport when multiple objects are loaded from the Content Browser. This setting is specifically for the UV Editor, which is part of the modeling tools in Unreal Engine 5.
This setting variable is used by the UVEditor plugin, which is part of the Editor module in Unreal Engine 5. The main subsystem that relies on this variable is the UVEditorSubsystem, as seen in the UVEditorSubsystem.cpp file.
The value of this variable is set using a console variable (CVar) system. It is initialized with a default value of 1, meaning the feature is enabled by default. Developers can change this value at runtime using console commands.
This variable interacts with another variable named CVarLivePreviewArrangementMode, which determines the arrangement mode when the live preview arrangement is enabled.
Developers must be aware that this variable affects the behavior of the UV Editor when loading multiple objects. When enabled, it will automatically arrange the objects in the viewport, which may or may not be desirable depending on the specific use case.
Best practices when using this variable include:
- Consider disabling it if manual arrangement of objects is preferred.
- Be aware of its interaction with CVarLivePreviewArrangementMode for fine-tuning the arrangement behavior.
- Use it in conjunction with other UV Editor settings for optimal workflow.
Regarding the associated variable CVarEnableLivePreviewArrangement:
The purpose of CVarEnableLivePreviewArrangement is to serve as the actual console variable that controls the EnableLivePreviewArrangement feature. It is an implementation detail of how the feature is exposed to the engine’s console variable system.
This variable is used within the UVEditorSubsystem, specifically in the StartUVEditor function. It determines whether the auto-arrangement feature should be applied when initializing the UV Editor with multiple targets.
The value of this variable is set through the console variable system and can be changed at runtime. It is initialized with a default value of 1 (enabled).
CVarEnableLivePreviewArrangement interacts directly with CVarLivePreviewArrangementMode to determine the specific arrangement method when enabled.
Developers should be aware that this variable is checked at runtime in the UVEditorSubsystem, and its value affects the behavior of the UV Editor initialization process.
Best practices for using this variable include:
- Use engine console commands to toggle this feature on or off as needed during development.
- Consider exposing this setting in the editor UI for easier access if it’s frequently adjusted.
- Document any project-specific preferences for this setting to maintain consistency across the development team.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Editor/UVEditor/Source/UVEditor/Private/UVEditorSubsystem.cpp:20
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarEnableLivePreviewArrangement(
TEXT("modeling.UVEditor.EnableLivePreviewArrangement"),
1,
TEXT("Enable auto arranging objects in the UV Editor's live viewport when multiple objects are loaded from the Content Browser."));
static TAutoConsoleVariable<int32> CVarLivePreviewArrangementMode(
TEXT("modeling.UVEditor.LivePreviewArrangementMode"),
0,
#Associated Variable and Callsites
This variable is associated with another variable named CVarEnableLivePreviewArrangement
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Editor/UVEditor/Source/UVEditor/Private/UVEditorSubsystem.cpp:19
Scope: file
Source code excerpt:
using namespace UE::Geometry;
static TAutoConsoleVariable<int32> CVarEnableLivePreviewArrangement(
TEXT("modeling.UVEditor.EnableLivePreviewArrangement"),
1,
TEXT("Enable auto arranging objects in the UV Editor's live viewport when multiple objects are loaded from the Content Browser."));
static TAutoConsoleVariable<int32> CVarLivePreviewArrangementMode(
TEXT("modeling.UVEditor.LivePreviewArrangementMode"),
#Loc: <Workspace>/Engine/Plugins/Editor/UVEditor/Source/UVEditor/Private/UVEditorSubsystem.cpp:267
Scope (from outer to inner):
file
function void UUVEditorSubsystem::StartUVEditor
Source code excerpt:
bool bEnableAutoArrangement = (CVarEnableLivePreviewArrangement.GetValueOnGameThread() > 0);
if (bEnableAutoArrangement && bInitializeTransformsFromBoundingBoxes && Targets.Num() > 0)
{
switch (CVarLivePreviewArrangementMode.GetValueOnGameThread())
{
case 0:
UVSubsystemLocals::ArrangeAsLine(ObjectTransforms, ObjectBoundingRadii, ObjectsAverageCenter);