modeling.UVEditor.LivePreviewArrangementMode

modeling.UVEditor.LivePreviewArrangementMode

#Overview

name: modeling.UVEditor.LivePreviewArrangementMode

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of modeling.UVEditor.LivePreviewArrangementMode is to control the arrangement pattern for the UV Editor’s Live Preview auto-arrangement feature. This setting is specifically used in the UV Editor plugin for Unreal Engine 5.

This setting variable is primarily used in the UV Editor subsystem, which is part of the UVEditor plugin. It’s referenced in the UVEditorSubsystem.cpp file, indicating its relevance to the UV editing functionality within the engine.

The value of this variable is set using a console variable (CVar) system. It’s initialized with a default value of 0, which corresponds to a “Line” arrangement pattern. The alternative value is 1, which represents a “Circular” arrangement pattern.

The associated variable CVarLivePreviewArrangementMode directly interacts with this setting. It’s used to retrieve the current value of the setting within the code.

Developers should be aware that this variable affects how multiple objects are arranged in the UV Editor’s live viewport when loaded from the Content Browser. The arrangement mode (Line or Circular) will impact the visual layout of the objects in the preview.

Best practices when using this variable include:

  1. Understanding the impact of each arrangement mode on your workflow.
  2. Considering performance implications when dealing with a large number of objects.
  3. Using the appropriate mode based on the specific UV editing task at hand.

Regarding the associated variable CVarLivePreviewArrangementMode:

The purpose of CVarLivePreviewArrangementMode is to provide a programmatic way to access and modify the modeling.UVEditor.LivePreviewArrangementMode setting within the C++ code.

This variable is used directly in the UV Editor subsystem to determine which arrangement function to call when auto-arranging objects in the live preview.

The value of this variable is set through the console variable system and can be accessed using the GetValueOnGameThread() method.

It interacts closely with the modeling.UVEditor.LivePreviewArrangementMode setting, essentially serving as its in-code representation.

Developers should be aware that changes to this variable will immediately affect the behavior of the auto-arrangement feature in the UV Editor.

Best practices for using CVarLivePreviewArrangementMode include:

  1. Using the GetValueOnGameThread() method to retrieve the current value safely.
  2. Considering thread safety when accessing this variable in multi-threaded contexts.
  3. Using the predefined values (0 for Line, 1 for Circular) to ensure consistent behavior.

#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:25

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarLivePreviewArrangementMode(
	TEXT("modeling.UVEditor.LivePreviewArrangementMode"),
	0,
	TEXT("Pattern to use for UV Editor Live Preview auto arrangement: 0 - Line, 1 - Circular"));

namespace UVSubsystemLocals
{
	void ArrangeAsLine(TArray<FTransform3d>& ObjectTransforms, TArray<double>& ObjectBoundingRadii, FVector3d& ObjectsAverageCenter)

#Associated Variable and Callsites

This variable is associated with another variable named CVarLivePreviewArrangementMode. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Plugins/Editor/UVEditor/Source/UVEditor/Private/UVEditorSubsystem.cpp:24

Scope: file

Source code excerpt:

	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,
	TEXT("Pattern to use for UV Editor Live Preview auto arrangement: 0 - Line, 1 - Circular"));

namespace UVSubsystemLocals
{

#Loc: <Workspace>/Engine/Plugins/Editor/UVEditor/Source/UVEditor/Private/UVEditorSubsystem.cpp:270

Scope (from outer to inner):

file
function     void UUVEditorSubsystem::StartUVEditor

Source code excerpt:

	if (bEnableAutoArrangement && bInitializeTransformsFromBoundingBoxes && Targets.Num() > 0)
	{
		switch (CVarLivePreviewArrangementMode.GetValueOnGameThread())
		{
		case 0: 
			UVSubsystemLocals::ArrangeAsLine(ObjectTransforms, ObjectBoundingRadii, ObjectsAverageCenter);
			break;
		case 1:
			UVSubsystemLocals::ArrangeAsCircles(ObjectTransforms, ObjectBoundingRadii, ObjectsAverageCenter);