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 …