Sequencer.RelativeTimecodeSmoothing
Sequencer.RelativeTimecodeSmoothing
#Overview
name: Sequencer.RelativeTimecodeSmoothing
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If nonzero, accumulate with platform time since when the timecodes were equal.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Sequencer.RelativeTimecodeSmoothing is to control the smoothing of relative timecodes in Unreal Engine’s Sequencer system. This setting is used to improve the accuracy and smoothness of timecode-based animations and sequences.
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 clear that this variable is utilized in the MovieSceneTimeController.cpp file, which is responsible for managing time-related operations in the Sequencer.
The value of this variable is set as a console variable (CVar) with a default value of 1. It can be modified at runtime through the console or configuration files.
The associated variable CVarSequencerRelativeTimecodeSmoothing directly interacts with Sequencer.RelativeTimecodeSmoothing. They share the same value and purpose.
Developers must be aware that:
- This variable affects how the engine accumulates time when timecodes are equal.
- It’s a boolean-like integer (0 for off, non-zero for on).
- Changing this value can impact the smoothness and accuracy of animations in Sequencer.
Best practices when using this variable include:
- Keep it enabled (value of 1) for most use cases to ensure smooth animations.
- Only disable it if you encounter specific issues related to timecode accumulation.
- Test thoroughly if you decide to modify this value, as it can affect the entire Sequencer system.
Regarding the associated variable CVarSequencerRelativeTimecodeSmoothing:
- It’s the actual CVar object that controls the Sequencer.RelativeTimecodeSmoothing setting.
- It’s defined as a static TAutoConsoleVariable
, allowing for runtime modifications. - It’s used in the FMovieSceneTimeController_RelativeTimecodeClock::OnRequestCurrentTime function to determine whether to accumulate time with platform time.
- Developers should use this variable when they need programmatic access to the smoothing setting within C++ code.
When working with CVarSequencerRelativeTimecodeSmoothing, developers should:
- Use CVarSequencerRelativeTimecodeSmoothing->GetInt() to check the current setting.
- Be cautious when modifying its value, as it can affect ongoing animations.
- Consider exposing this setting in user-facing configuration options if fine-tuning is necessary for specific projects.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/MovieSceneTimeController.cpp:8
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarSequencerRelativeTimecodeSmoothing(
TEXT("Sequencer.RelativeTimecodeSmoothing"),
1,
TEXT("If nonzero, accumulate with platform time since when the timecodes were equal."),
ECVF_Default);
static TAutoConsoleVariable<float> CVarSequencerSecondsPerFrame(
TEXT("Sequencer.SecondsPerFrame"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarSequencerRelativeTimecodeSmoothing
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/MovieSceneTimeController.cpp:7
Scope: file
Source code excerpt:
#include "Misc/App.h"
static TAutoConsoleVariable<int32> CVarSequencerRelativeTimecodeSmoothing(
TEXT("Sequencer.RelativeTimecodeSmoothing"),
1,
TEXT("If nonzero, accumulate with platform time since when the timecodes were equal."),
ECVF_Default);
static TAutoConsoleVariable<float> CVarSequencerSecondsPerFrame(
#Loc: <Workspace>/Engine/Source/Runtime/MovieScene/Private/MovieSceneTimeController.cpp:150
Scope (from outer to inner):
file
function FFrameTime FMovieSceneTimeController_RelativeTimecodeClock::OnRequestCurrentTime
Source code excerpt:
// That's not necessarily desirable, so accumulate with platform time since when the timecodes were equal.
AccumulatedFrameTime = 0;
if (CVarSequencerRelativeTimecodeSmoothing->GetInt() && CurrentFrameTime.IsSet())
{
if (LastCurrentFrameTime.IsSet() && LastCurrentFrameTime.GetValue() == CurrentFrameTime.GetValue().Time)
{
if (TimeSinceCurrentFrameTime.IsSet())
{
AccumulatedFrameTime = FPlatformTime::Seconds() - TimeSinceCurrentFrameTime.GetValue();