Get Current Sequencer

I’m creating toolbar button plugin.

I can create a new sequencer object,
but I don’t know how to get object that is already opened.
How to get editing sequence object?

void FTestModule::PluginButtonClicked()
    // I'd like to get in here

please help, thank you

In [project name].build.cs, add LevelSequenceEditor to PrivateDependencyModuleNames.

    PrivateDependencyModuleNames.AddRange(new string[]{"LevelSequenceEditor",});

Include header file.

#include "Private/LevelSequenceEditorToolkit.h"

Opened Sequencer can be got as follows.

// Get a list of ULevelSequence
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(FName("AssetRegistry"));
IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();
TArray<FAssetData> LevelSequenceAssetList;
AssetRegistry.GetAssetsByClass(ULevelSequence::StaticClass()->GetFName(), LevelSequenceAssetList);

for (FAssetData LevelSequenceAsset : LevelSequenceAssetList)
	// Get LevelSequenceEditor
	ULevelSequence* LevelSeq = Cast<ULevelSequence>(LevelSequenceAsset.GetAsset());
	IAssetEditorInstance* AssetEditor = FAssetEditorManager::Get().FindEditorForAsset(LevelSeq, true);
	FLevelSequenceEditorToolkit* LevelSequenceEditor = (FLevelSequenceEditorToolkit*)AssetEditor;
	if (LevelSequenceEditor != nullptr)
		// Get current Sequencer
		ISequencer* Sequencer = LevelSequenceEditor->GetSequencer().Get();

Another module and header file is also required for this source code.

Please refer to the API document and add PrivateDependencyModuleNames and header file (e.g. AssetRegistryModule.h).

How do I know the sequence’s play direction, forward or backward? In Editor state.

please check bReversePlayback.