MaxViewRange

MaxViewRange

#Overview

name: MaxViewRange

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of MaxViewRange is to define the maximum allowed range for the view in the Curve Editor within Unreal Engine 5. This setting variable is primarily used in the context of the Curve Editor, which is a tool for editing interpolation curves used in various aspects of game development, such as animation, particle systems, and material parameters.

MaxViewRange is utilized by the Curve Editor subsystem, which is part of the UnrealEd module. Specifically, it’s used in the DistCurveEditor, which is responsible for displaying and manipulating distribution curves.

The value of this variable is set in the UCurveEdOptions class, which is a configuration object for the Curve Editor. It’s defined as an UPROPERTY with the EditAnywhere and config specifiers, meaning it can be edited in the editor and saved to configuration files.

MaxViewRange interacts with MinViewRange, another setting variable that defines the minimum allowed view range. These two variables work together to constrain the view range of the Curve Editor.

Developers must be aware that:

  1. Attempting to set a view range larger than MaxViewRange will be rejected by the editor.
  2. The value of MaxViewRange should be carefully chosen to provide enough flexibility for editing while preventing impractical zoom levels.

Best practices when using this variable include:

  1. Setting a reasonable upper limit that allows for detailed editing of curves without permitting excessive zooming out.
  2. Ensuring that MaxViewRange is always greater than MinViewRange.
  3. Consider the typical use cases for your project’s curves when setting this value.
  4. If modifying this value programmatically, ensure to update any related UI or validation logic that depends on it.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/DistCurveEditor/Private/CurveEditorSharedData.cpp:16

Scope (from outer to inner):

file
function     FCurveEditorSharedData::FCurveEditorSharedData

Source code excerpt:

	check(EditorOptions);
	MinViewRange = EditorOptions->MinViewRange;
	MaxViewRange = EditorOptions->MaxViewRange;

	EdSetup = InEdSetup;

	LabelContentBoxHeight = 0;

	RightClickCurveIndex = INDEX_NONE;

#Loc: <Workspace>/Engine/Source/Editor/DistCurveEditor/Private/CurveEditorSharedData.cpp:59

Scope (from outer to inner):

file
function     void FCurveEditorSharedData::SetCurveView

Source code excerpt:

	float InSize = InEndIn - InStartIn;
	float OutSize = InEndOut - InStartOut;
	if(InSize < MinViewRange  || InSize > MaxViewRange || OutSize < MinViewRange || OutSize > MaxViewRange)
	{
		return;
	}

	StartIn		= EdSetup->Tabs[ EdSetup->ActiveTab ].ViewStartInput	= InStartIn;
	EndIn		= EdSetup->Tabs[ EdSetup->ActiveTab ].ViewEndInput		= InEndIn;

#Loc: <Workspace>/Engine/Source/Editor/DistCurveEditor/Private/CurveEditorSharedData.h:136

Scope (from outer to inner):

file
class        class FCurveEditorSharedData

Source code excerpt:

	float StartOut;
	float EndOut;
	float MaxViewRange;
	float MinViewRange;
	bool bShowPositionMarker;
	float MarkerPosition;
	FColor MarkerColor;
	bool bShowEndMarker;
	float EndMarkerPosition;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Preferences/CurveEdOptions.h:23

Scope (from outer to inner):

file
class        class UCurveEdOptions : public UObject

Source code excerpt:


	UPROPERTY(EditAnywhere, config, Category=Options)
	float MaxViewRange;

	UPROPERTY(EditAnywhere, config, Category=Options)
	FLinearColor BackgroundColor;

	UPROPERTY(EditAnywhere, config, Category=Options)
	FLinearColor LabelColor;