Sequencer.SmartAutoBlendLocationPercentage
Sequencer.SmartAutoBlendLocationPercentage
#Overview
name: Sequencer.SmartAutoBlendLocationPercentage
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Percentage near the next value that the tangent will blend to the adjacent tangent, if over 1.0 we won\'t blend. Default to 0.8
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Sequencer.SmartAutoBlendLocationPercentage is to control the blending behavior of tangents in curve channels within Unreal Engine’s Sequencer system. It specifically determines the percentage near the next key value where the tangent will blend to the adjacent tangent.
This setting variable is primarily used in the MovieScene module, which is a core part of Unreal Engine’s cinematics and animation sequencing system. Based on the callsites, it’s utilized in the curve channel implementation of the MovieScene subsystem.
The value of this variable is set as a console variable with a default value of 0.8 (80%). It can be modified at runtime through the console or configuration files.
The associated variable CVarSequencerSmartAutoBlendLocationPercentage directly interacts with Sequencer.SmartAutoBlendLocationPercentage. It’s implemented as a TAutoConsoleVariable, which allows for easy access and modification of the value in C++ code.
Developers must be aware that this variable affects the automatic tangent calculation for curve channels in Sequencer. A value of 1.0 or higher will prevent blending, while lower values will increase the range where blending occurs.
Best practices when using this variable include:
- Understand its impact on curve interpolation in Sequencer.
- Adjust the value if the default blending behavior doesn’t meet specific animation requirements.
- Consider exposing this setting to artists or technical animators if fine-tuning is necessary for different projects or sequences.
Regarding the associated variable CVarSequencerSmartAutoBlendLocationPercentage:
The purpose of CVarSequencerSmartAutoBlendLocationPercentage is to provide a programmatic interface to access and modify the Sequencer.SmartAutoBlendLocationPercentage value within C++ code.
This variable is used directly in the MovieScene module, specifically in the curve channel implementation (MovieSceneCurveChannelImpl.cpp).
The value of CVarSequencerSmartAutoBlendLocationPercentage is set when the console variable is initialized, but it can be modified at runtime using console commands or through C++ code.
It interacts directly with the Sequencer.SmartAutoBlendLocationPercentage setting, effectively serving as its in-code representation.
Developers should be aware that changes to this variable will immediately affect the behavior of smart tangent calculations in Sequencer.
Best practices for using CVarSequencerSmartAutoBlendLocationPercentage include:
- Use GetFloat() method to access the current value in C++ code.
- Consider caching the value if it’s accessed frequently in performance-critical sections.
- Be cautious when modifying this value, as it can have wide-ranging effects on curve interpolation in Sequencer.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/Channels/MovieSceneCurveChannelImpl.cpp:25
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarSequencerSmartAutoBlendLocationPercentage(
TEXT("Sequencer.SmartAutoBlendLocationPercentage"),
0.8,
TEXT("Percentage near the next value that the tangent will blend to the adjacent tangent, if over 1.0 we won't blend. Default to 0.8"),
ECVF_Default);
namespace UE
#Associated Variable and Callsites
This variable is associated with another variable named CVarSequencerSmartAutoBlendLocationPercentage
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/Channels/MovieSceneCurveChannelImpl.cpp:24
Scope: file
Source code excerpt:
ECVF_Default);
static TAutoConsoleVariable<float> CVarSequencerSmartAutoBlendLocationPercentage(
TEXT("Sequencer.SmartAutoBlendLocationPercentage"),
0.8,
TEXT("Percentage near the next value that the tangent will blend to the adjacent tangent, if over 1.0 we won't blend. Default to 0.8"),
ECVF_Default);
#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/Channels/MovieSceneCurveChannelImpl.cpp:965
Scope (from outer to inner):
file
function float TMovieSceneCurveChannelImpl<ChannelType>::CalcSmartTangent
Source code excerpt:
else
{
const float BlendToNextRange = CVarSequencerSmartAutoBlendLocationPercentage->GetFloat();
const double ValDiff = FMath::Abs<double>(NextKey.Value - PrevKey.Value);
const double OurDiff = FMath::Abs<double>(ThisKey.Value - PrevKey.Value);
//ValDiff won't be zero ever due to previous check
double PercDiff = OurDiff / ValDiff;
float NextTangent = (NextKey.InterpMode == RCIM_Cubic && (NextKey.TangentMode == RCTM_Auto || NextKey.TangentMode == RCTM_SmartAuto)) ?
0.0 : NextKey.Tangent.ArriveTangent;