Sequencer.AutoScrubCurveExponent
Sequencer.AutoScrubCurveExponent
#Overview
name: Sequencer.AutoScrubCurveExponent
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
How much to ramp in and out the scrub speed when auto-scrubbing
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Sequencer.AutoScrubCurveExponent is to control the easing of the scrubbing speed when auto-scrubbing in the Unreal Engine Sequencer. It determines how quickly the scrubbing speed ramps up and down at the beginning and end of an auto-scrub operation.
This setting variable is primarily used in the Sequencer module of Unreal Engine’s editor subsystem. It’s specifically utilized in the FSequencer class, which is responsible for managing the Sequencer interface and functionality.
The value of this variable is set as a console variable (CVar) with a default value of 2.0f. It can be modified at runtime through the console or programmatically.
The Sequencer.AutoScrubCurveExponent variable interacts closely with another variable called CVarAutoScrubSpeed. Together, these variables control the behavior of auto-scrubbing in the Sequencer.
Developers should be aware that this variable affects the user experience when using the auto-scrub feature in the Sequencer. A higher value will result in a longer easing period, making the scrubbing feel smoother but potentially slower to reach full speed. A lower value will make the scrubbing more responsive but potentially feel more abrupt.
Best practices when using this variable include:
- Adjusting it in conjunction with CVarAutoScrubSpeed to achieve the desired scrubbing behavior.
- Testing different values to find the right balance between smooth motion and responsiveness for your project’s needs.
- Considering exposing this setting to users if fine-tuning of the scrubbing behavior is important for your project.
Regarding the associated variable CVarAutoScrubCurveExponent:
The purpose of CVarAutoScrubCurveExponent is to provide a programmatic interface to the Sequencer.AutoScrubCurveExponent setting. It’s an instance of TAutoConsoleVariable
This variable is used directly in the Sequencer’s Tick function to calculate the easing of the scrub speed. It’s retrieved using the GetFloat() method and then used in the auto-scrubbing calculations.
The value of CVarAutoScrubCurveExponent is set when it’s declared, matching the default value of Sequencer.AutoScrubCurveExponent (2.0f).
Developers should be aware that modifying CVarAutoScrubCurveExponent at runtime will immediately affect the auto-scrubbing behavior in the Sequencer.
Best practices for using CVarAutoScrubCurveExponent include:
- Using it to dynamically adjust the auto-scrub behavior based on specific scenarios or user preferences.
- Caching the value if it’s used frequently to avoid repeated calls to GetFloat().
- Considering adding UI elements to allow users to adjust this value if scrubbing behavior customization is a desired feature in your project.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/Sequencer.cpp:180
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarAutoScrubCurveExponent(
TEXT("Sequencer.AutoScrubCurveExponent"),
2.0f,
TEXT("How much to ramp in and out the scrub speed when auto-scrubbing"));
static TAutoConsoleVariable<bool> CVarTimeUndo(
TEXT("Sequencer.TimeUndo"),
false,
#Associated Variable and Callsites
This variable is associated with another variable named CVarAutoScrubCurveExponent
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/Sequencer.cpp:179
Scope: file
Source code excerpt:
TEXT("How fast to scrub forward/backward when auto-scrubbing"));
static TAutoConsoleVariable<float> CVarAutoScrubCurveExponent(
TEXT("Sequencer.AutoScrubCurveExponent"),
2.0f,
TEXT("How much to ramp in and out the scrub speed when auto-scrubbing"));
static TAutoConsoleVariable<bool> CVarTimeUndo(
TEXT("Sequencer.TimeUndo"),
#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/Sequencer.cpp:977
Scope (from outer to inner):
file
function void FSequencer::Tick
Source code excerpt:
{
const double ScrubSpeed = CVarAutoScrubSpeed->GetFloat(); // How fast to scrub at peak curve speed
const double AutoScrubExp = CVarAutoScrubCurveExponent->GetFloat(); // How long to ease in and out. Bigger numbers allow for longer easing.
const double SecondsPerFrame = GetFocusedTickResolution().AsInterval() / ScrubSpeed;
const int32 TotalFrames = FMath::Abs(AutoScrubTarget.GetValue().DestinationTime.GetFrame().Value - AutoScrubTarget.GetValue().SourceTime.GetFrame().Value);
const double TargetSeconds = (double)TotalFrames * SecondsPerFrame;
double ElapsedSeconds = FPlatformTime::Seconds() - AutoScrubTarget.GetValue().StartTime;