bAutoSetTrackDefaults

bAutoSetTrackDefaults

#Overview

name: bAutoSetTrackDefaults

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

It is referenced in 9 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bAutoSetTrackDefaults is to control whether track defaults are automatically set when modifying tracks in Unreal Engine’s Sequencer system. This setting is primarily used in the animation and cinematics systems, specifically within the Sequencer tool.

This setting variable is mainly relied upon by the Sequencer module and the MovieSceneTextTrack plugin. It’s used in various parts of the Sequencer system, including key editors and text track editors.

The value of this variable is set in the USequencerSettings class, which is part of the Sequencer module. It can be modified through the Sequencer settings interface or programmatically using the SetAutoSetTrackDefaults function.

bAutoSetTrackDefaults interacts with other variables and functions related to key editing and track manipulation in the Sequencer system. It affects how keyframes are added and how default values are set for tracks.

Developers must be aware that when this variable is set to true, it will automatically update track default values when modifying tracks. This can affect the behavior of tracks when there are no keys present.

Best practices when using this variable include:

  1. Consider the implications of automatically setting track defaults on your animation workflow.
  2. Be aware that changing this setting may affect how keyframes are added and how default values are propagated.
  3. Use the GetAutoSetTrackDefaults() and SetAutoSetTrackDefaults() functions to read or modify this setting programmatically.
  4. Remember that this setting is saved in the config file, so changes will persist between editor sessions.

When working with Sequencer tracks and keyframes, always consider the current state of this setting, as it can significantly impact the behavior of the Sequencer system.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:855, section: [LevelSequenceEditor SequencerSettings]

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:863, section: [TemplateSequenceEditor SequencerSettings]

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:871, section: [TakeRecorderSequenceEditor SequencerSettings]

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:881, section: [EmbeddedActorSequenceEditor SequencerSettings]

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:908, section: [DaySequenceEditor SequencerSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieSceneTextTrack/Source/MovieSceneTextTrackEditor/Private/Widgets/STextKeyEditor.cpp:86

Scope (from outer to inner):

file
namespace    UE::MovieScene
function     void STextKeyEditor::OnTextCommitted

Source code excerpt:

	}

	const bool bAutoSetTrackDefaults = Sequencer->GetAutoSetTrackDefaults();
	const FKeySelection& KeySelection = Sequencer->GetViewModel()->GetSelection()->KeySelection;
	if (KeySelection.Num())
	{
		for (FKeyHandle Key : KeySelection)
		{
			// Make sure we only manipulate the values of the channel with the same channel type we're editing

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieSceneTextTrack/Source/MovieSceneTextTrackEditor/Private/Widgets/STextKeyEditor.cpp:126

Scope (from outer to inner):

file
namespace    UE::MovieScene
function     void STextKeyEditor::OnTextCommitted

Source code excerpt:

			bool bHasAnyKeys = Channel->GetNumKeys() != 0;

			if (bHasAnyKeys || bAutoSetTrackDefaults == false)
			{
				// When auto setting track defaults are disabled, add a key even when it's empty so that the changed
				// value is saved and is propagated to the property.
				AddKeyToChannel(Channel, CurrentTime, InText, Interpolation);
				bHasAnyKeys = Channel->GetNumKeys() != 0;
			}

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieSceneTextTrack/Source/MovieSceneTextTrackEditor/Private/Widgets/STextKeyEditor.cpp:149

Scope (from outer to inner):

file
namespace    UE::MovieScene
function     void STextKeyEditor::OnTextCommitted

Source code excerpt:

	// Always update the default value when auto-set default values is enabled so that the last changes
	// are always saved to the track.
	if (bAutoSetTrackDefaults)
	{
		SetChannelDefault(Channel, InText);
	}

	// need to tell channel change happened (float will call AutoSetTangents())
	Channel->PostEditChange();

#Loc: <Workspace>/Engine/Source/Editor/MovieSceneTools/Private/CurveKeyEditors/SequencerKeyEditor.h:115

Scope (from outer to inner):

file
function     void SetValue

Source code excerpt:

		}

		const bool  bAutoSetTrackDefaults = Sequencer->GetAutoSetTrackDefaults();

		const FKeySelection& KeySelection = Sequencer->GetViewModel()->GetSelection()->KeySelection;

		// Allow editing the key selection if the key editor's channel is one of the selected key's channels
		bool bAllowEditingKeySelection = false;
		for (FKeyHandle Key : KeySelection)

#Loc: <Workspace>/Engine/Source/Editor/MovieSceneTools/Private/CurveKeyEditors/SequencerKeyEditor.h:165

Scope (from outer to inner):

file
function     void SetValue

Source code excerpt:

				bool bHasAnyKeys = Channel->GetNumKeys() != 0;

				if (bHasAnyKeys || bAutoSetTrackDefaults == false)
				{
					// When auto setting track defaults are disabled, add a key even when it's empty so that the changed
					// value is saved and is propagated to the property.
					AddKeyToChannel(Channel, CurrentTime, InValue, Interpolation);
					bHasAnyKeys = Channel->GetNumKeys() != 0;
				}

#Loc: <Workspace>/Engine/Source/Editor/MovieSceneTools/Private/CurveKeyEditors/SequencerKeyEditor.h:188

Scope (from outer to inner):

file
function     void SetValue

Source code excerpt:

		// Always update the default value when auto-set default values is enabled so that the last changes
		// are always saved to the track.
		if (bAutoSetTrackDefaults)
		{
			SetChannelDefault(Channel, InValue);
		}
		 
		//need to tell channel change happened (float will call AutoSetTangents())
		Channel->PostEditChange();

#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/SequencerSettings.cpp:13

Scope (from outer to inner):

file
function     USequencerSettings::USequencerSettings

Source code excerpt:

	KeyGroupMode = EKeyGroupMode::KeyChanged;
	KeyInterpolation = EMovieSceneKeyInterpolation::Auto;
	bAutoSetTrackDefaults = false;
	SpawnPosition = SSP_Origin;
	bCreateSpawnableCameras = true;
	bShowRangeSlider = false;
	bIsSnapEnabled = true;
	bSnapKeyTimesToInterval = true;
	bSnapKeyTimesToKeys = true;

#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Private/SequencerSettings.cpp:840

Scope (from outer to inner):

file
function     bool USequencerSettings::GetAutoSetTrackDefaults

Source code excerpt:

bool USequencerSettings::GetAutoSetTrackDefaults() const
{
	return bAutoSetTrackDefaults;
}

void USequencerSettings::SetAutoSetTrackDefaults(bool bInAutoSetTrackDefaults)
{
	if (bInAutoSetTrackDefaults != bAutoSetTrackDefaults)
	{
		bAutoSetTrackDefaults = bInAutoSetTrackDefaults;
		SaveConfig();
	}
}

bool USequencerSettings::ShouldShowDebugVisualization() const
{

#Loc: <Workspace>/Engine/Source/Editor/Sequencer/Public/SequencerSettings.h:494

Scope (from outer to inner):

file
class        class USequencerSettings : public UObject

Source code excerpt:

	/** Whether or not track defaults will be automatically set when modifying tracks. */
	UPROPERTY( config, EditAnywhere, Category=Keyframing, meta = (ToolTip = "When setting keys on properties and transforms automatically update the track default values used when there are no keys."))
	bool bAutoSetTrackDefaults;

	/** The default location of a spawnable when it is first dragged into the viewport from the content browser. */
	UPROPERTY( config, EditAnywhere, Category=General )
	TEnumAsByte<ESequencerSpawnPosition> SpawnPosition;

	/** Enable or disable creating of spawnable cameras whenever cameras are created. */