Get Current Sequencer C++

Okay so, when we want to work with ULevelSequence, the way to get the current sequencer is as follow, okay easy :

TSharedPtr<ISequencer> GetSequencer(ULevelSequence* LevelSequence)
{
	//if getting sequencer from level sequence need to use the current(leader), not the focused
	if (LevelSequence)
	{
		if (UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>())
		{
			IAssetEditorInstance* AssetEditor = AssetEditorSubsystem->FindEditorForAsset(LevelSequence, false);
			const ILevelSequenceEditorToolkit* LevelSequenceEditor = static_cast<ILevelSequenceEditorToolkit*>(AssetEditor);
			return LevelSequenceEditor ? LevelSequenceEditor->GetSequencer() : nullptr;
		}
	}
	return nullptr;
}

But what about UCameraAnimationSequence, and more openly UTemplateSequence ??? There is no public class for ITemplateSequenceEditorToolkit that provide a GetSequencer() function, Epic totally forgot it. (seems they just forgot to subclass ILevelSequenceEditorToolkit by the way …). So ???

So boring to see the variable set as “private” when we need it and nobody have think of a little function to get access …

That’s right, this makes me very disgusted.

Currently in 5.5, especially when using command to start in the background for a series of asset processing of Levelsequence outside of the Editor, I have not found a solution yet.

A series of APIs in FSequencerUtilities all require this ■■■■ ISequencer.

Before 5.5, it was possible to bypass this thing, but now I can only say that this thing makes me very disgusted.