bAutoScrollEnabled

bAutoScrollEnabled

#Overview

name: bAutoScrollEnabled

The value of this variable can be defined or overridden in .ini config files. 2 .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 bAutoScrollEnabled is to control the auto-scroll functionality in various tree views and timeline interfaces within Unreal Engine 5. This setting is primarily used in the animation and sequencer systems to enhance user experience when working with hierarchical data or timeline-based content.

This setting variable is relied upon by the following Unreal Engine subsystems and modules:

  1. Control Rig Editor Plugin (Animation system)
  2. Sequencer (Editor module)

The value of this variable is typically set in two ways:

  1. In the Control Rig Editor, it’s set through constructor arguments for SModularRigTreeView and SRigHierarchyTreeView classes.
  2. In the Sequencer, it’s initialized in the USequencerSettings constructor and can be modified through the SetAutoScrollEnabled function.

This variable interacts with other variables and functions related to scrolling and mouse position, such as LastMousePosition, TimeAtMousePosition, and ScrollBy functions.

Developers should be aware of the following when using this variable:

  1. It affects the behavior of tree views and timelines during user interaction.
  2. In the Control Rig Editor, it’s used to determine whether automatic scrolling should occur when the mouse is near the edges of the view.
  3. In the Sequencer, it controls whether the timeline automatically scrolls during playback.

Best practices when using this variable include:

  1. Provide a user-accessible option to toggle this feature, as some users may prefer manual scrolling.
  2. Ensure that the auto-scroll behavior is smooth and doesn’t interfere with other user interactions.
  3. Consider the performance implications of frequent auto-scrolling, especially with large data sets.
  4. When implementing auto-scroll functionality, use this variable consistently across related UI components for a unified user experience.

#Setting Variables

#References In INI files

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

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Editor/SModularRigTreeView.cpp:591

Scope (from outer to inner):

file
function     void SModularRigTreeView::Construct

Source code excerpt:

{
	Delegates = InArgs._RigTreeDelegates;
	bAutoScrollEnabled = InArgs._AutoScrollEnabled;

	STreeView<TSharedPtr<FModularRigTreeElement>>::FArguments SuperArgs;
	SuperArgs.HeaderRow(InArgs._HeaderRow);
	SuperArgs.TreeItemsSource(&RootElements);
	SuperArgs.SelectionMode(ESelectionMode::Multi);
	SuperArgs.OnGenerateRow(this, &SModularRigTreeView::MakeTableRowWidget, false);

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Editor/SModularRigTreeView.cpp:652

Scope (from outer to inner):

file
function     void SModularRigTreeView::Tick

Source code excerpt:

			if((WidgetPosition.Y < AutoScrollDistance) || (WidgetPosition.Y > PaintGeometry.Size.Y - AutoScrollDistance))
			{
				if(bAutoScrollEnabled)
				{
					const bool bScrollUp = (WidgetPosition.Y < AutoScrollDistance);

					const float DeltaInSlateUnits = (bScrollUp ? -InDeltaTime : InDeltaTime) * AutoScrollSpeed; 
					ScrollBy(GetCachedGeometry(), DeltaInSlateUnits, EAllowOverscroll::No);
				}

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Editor/SModularRigTreeView.h:253

Scope (from outer to inner):

file
class        class SModularRigTreeView : public STreeView<TSharedPtr<FModularRigTreeElement>>

Source code excerpt:

	FModularRigTreeDelegates Delegates;

	bool bAutoScrollEnabled;
	FVector2D LastMousePosition;
	double TimeAtMousePosition;

	friend class SModularRigModel;
};

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Editor/SRigHierarchyTreeView.cpp:291

Scope (from outer to inner):

file
function     void SRigHierarchyTreeView::Construct

Source code excerpt:

{
	Delegates = InArgs._RigTreeDelegates;
	bAutoScrollEnabled = InArgs._AutoScrollEnabled;

	STreeView<TSharedPtr<FRigTreeElement>>::FArguments SuperArgs;
	SuperArgs.TreeItemsSource(&RootElements);
	SuperArgs.SelectionMode(ESelectionMode::Multi);
	SuperArgs.OnGenerateRow(this, &SRigHierarchyTreeView::MakeTableRowWidget, false);
	SuperArgs.OnGetChildren(this, &SRigHierarchyTreeView::HandleGetChildrenForTree);

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Editor/SRigHierarchyTreeView.cpp:353

Scope (from outer to inner):

file
function     void SRigHierarchyTreeView::Tick

Source code excerpt:

			if((WidgetPosition.Y < AutoScrollDistance) || (WidgetPosition.Y > PaintGeometry.Size.Y - AutoScrollDistance))
			{
				if(bAutoScrollEnabled)
				{
					const bool bScrollUp = (WidgetPosition.Y < AutoScrollDistance);

					const float DeltaInSlateUnits = (bScrollUp ? -InDeltaTime : InDeltaTime) * AutoScrollSpeed; 
					ScrollBy(GetCachedGeometry(), DeltaInSlateUnits, EAllowOverscroll::No);
				}

#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRigEditor/Private/Editor/SRigHierarchyTreeView.h:373

Scope (from outer to inner):

file
class        class SRigHierarchyTreeView : public STreeView<TSharedPtr<FRigTreeElement>>

Source code excerpt:

	FRigTreeDelegates Delegates;

	bool bAutoScrollEnabled;
	FVector2D LastMousePosition;
	double TimeAtMousePosition;

	friend class SRigHierarchy;
};

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

Scope (from outer to inner):

file
function     USequencerSettings::USequencerSettings

Source code excerpt:

	bShowSelectedNodesOnly = false;
	ZoomPosition = ESequencerZoomPosition::SZP_CurrentTime;
	bAutoScrollEnabled = false;
	bLinkCurveEditorTimeRange = false;
	bSynchronizeCurveEditorSelection = true;
	bIsolateCurveEditorToSelection = true;
	LoopMode = ESequencerLoopMode::SLM_NoLoop;
	bSnapKeysAndSectionsToPlayRange = false;
	bResetPlayheadWhenNavigating = false;

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

Scope (from outer to inner):

file
function     bool USequencerSettings::GetAutoScrollEnabled

Source code excerpt:

bool USequencerSettings::GetAutoScrollEnabled() const
{
	return bAutoScrollEnabled;
}

void USequencerSettings::SetAutoScrollEnabled(bool bInAutoScrollEnabled)
{
	if (bAutoScrollEnabled != bInAutoScrollEnabled)
	{
		bAutoScrollEnabled = bInAutoScrollEnabled;
		SaveConfig();
	}
}

ESequencerLoopMode USequencerSettings::GetLoopMode() const
{

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

Scope (from outer to inner):

file
class        class USequencerSettings : public UObject

Source code excerpt:

	/** Enable or disable auto scroll in the timeline when playing. */
	UPROPERTY( config, EditAnywhere, Category=Timeline )
	bool bAutoScrollEnabled;

	/** Enable or disable linking the curve editor time range to the sequencer timeline's time range. */
	UPROPERTY( config, EditAnywhere, Category=CurveEditor )
	bool bLinkCurveEditorTimeRange;

	/** When enabled, changing the sequencer tree selection will also select the relevant nodes in the curve editor tree if possible. */