Sequencer.TimeUndo
Sequencer.TimeUndo
#Overview
name: Sequencer.TimeUndo
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enable/disable ability to undo time when making changes
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Sequencer.TimeUndo is to enable or disable the ability to undo time changes when making modifications in the Unreal Engine Sequencer system. This setting variable is primarily used for the Sequencer module, which is part of the Editor subsystem in Unreal Engine.
The Unreal Engine Sequencer module relies on this setting variable. It is used to control the functionality of undoing time-related changes within the Sequencer tool, which is crucial for cinematic and animation work in Unreal Engine projects.
The value of this variable is set as a console variable (CVar) with a default value of false. It can be modified at runtime through console commands or programmatically.
The associated variable CVarTimeUndo interacts directly with Sequencer.TimeUndo. They share the same value and purpose, with CVarTimeUndo being the actual TAutoConsoleVariable instance used in the code.
Developers must be aware that this variable affects the undo/redo functionality specifically for time-related changes in the Sequencer. When enabled, it allows for more granular control over time-based edits, but may also impact performance or memory usage due to the additional undo/redo information being stored.
Best practices when using this variable include:
- Only enable it when working on complex time-based sequences where undoing time changes is crucial.
- Be mindful of potential performance impacts when enabled, especially on larger projects.
- Use it in conjunction with other Sequencer-related settings for optimal workflow.
Regarding the associated variable CVarTimeUndo:
The purpose of CVarTimeUndo is to provide a programmatic interface for the Sequencer.TimeUndo setting. It is the actual console variable instance that controls the time undo functionality in the Sequencer module.
CVarTimeUndo is used directly in the Sequencer module’s code to determine whether to enable the time undo/redo functionality. It is checked in the InitSequencer function to decide whether to create and set up the TimeUndoRedoHandler.
The value of CVarTimeUndo is set when the console variable is initialized, with a default value of false. It can be changed at runtime using console commands or through code that interfaces with console variables.
CVarTimeUndo interacts closely with the Sequencer’s undo/redo system, particularly the TimeUndoRedoHandler and USequencerTimeChangeUndoRedoProxy classes.
Developers should be aware that changing the value of CVarTimeUndo at runtime will affect the Sequencer’s behavior regarding time-based undo operations. Enabling it may have performance implications, especially for complex sequences.
Best practices for using CVarTimeUndo include:
- Use it in conjunction with other Sequencer settings for a cohesive editing experience.
- Consider exposing the option to toggle this setting in user-facing tools or project settings for easier access.
- Monitor performance when enabled, especially in projects with extensive use of Sequencer.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/Sequencer.cpp:185
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarTimeUndo(
TEXT("Sequencer.TimeUndo"),
false,
TEXT("Enable/disable ability to undo time when making changes"));
namespace UE
{
namespace Sequencer
#Associated Variable and Callsites
This variable is associated with another variable named CVarTimeUndo
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/Sequencer.cpp:184
Scope: file
Source code excerpt:
TEXT("How much to ramp in and out the scrub speed when auto-scrubbing"));
static TAutoConsoleVariable<bool> CVarTimeUndo(
TEXT("Sequencer.TimeUndo"),
false,
TEXT("Enable/disable ability to undo time when making changes"));
namespace UE
{
#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/Sequencer.cpp:629
Scope (from outer to inner):
file
function void FSequencer::InitSequencer
Source code excerpt:
NotifyMovieSceneDataChanged( EMovieSceneDataChangeType::ActiveMovieSceneChanged );
if (CVarTimeUndo->GetBool())
{
TimeUndoRedoHandler.UndoRedoProxy = NewObject<USequencerTimeChangeUndoRedoProxy>(GetTransientPackage(), NAME_None);
TimeUndoRedoHandler.SetSequencer(SharedThis(this));
TimeUndoRedoHandler.UndoRedoProxy->SetFlags(RF_Transactional | RF_Transient);
}