Description

ISequencer :: OnStopEvent is executed when pause, but not when playing to the last frame and stopping automatically.

This is because OnStopDelegate.Broadcast(); is only in FSequencer::Pause(). When it stops automatically, the process is called in the following order, so pause () is not executed.

 

> UnrealEditor-MovieScene-Win64-Debug.dll! FMovieSceneTimeController :: StopPlaying (const FQualifiedFrameTime & InStopTime) Line 61 C ++
  UnrealEditor-MovieScene-Win64-Debug.dll! FMovieSceneTimeController :: PlayerStatusChanged (EMovieScenePlayerStatus :: Type InStatus, const FQualifiedFrameTime & InCurrentTime) Line 43 C ++
  UnrealEditor-Sequencer-Win64-Debug.dll! FSequencer :: SetPlaybackStatus (EMovieScenePlayerStatus :: Type InPlaybackStatus) Line 4176 C ++
  UnrealEditor-Sequencer-Win64-Debug.dll! FSequencer :: SetLocalTimeLooped (FFrameTime NewLocalTime) Line 4846 C ++
  UnrealEditor-Sequencer-Win64-Debug.dll! F Sequencer :: Tick (float InDeltaTime) Line 766 C ++

So you can fix this problem by adding pause() as below.

 

void FSequencer::SetLocalTimeLooped(FFrameTime NewLocalTime)
{
...// Set the playback status if we need to
	if (NewPlaybackStatus.IsSet())
	{
		////
		//SetPlaybackStatus(NewPlaybackStatus.GetValue());
		//// Evaluate the sequence with the new status
		//EvaluateInternal(EvalRange);
		if (NewPlaybackStatus->Stopped)
		{
			Pause();
		}
		else
		{
			SetPlaybackStatus(NewPlaybackStatus.GetValue());
			// Evaluate the sequence with the new status
			EvaluateInternal(EvalRange);
		}
		////
	}
}

 

Steps to Reproduce
  1. Bind any Event to ISequencer::OnStopEvent
  2. Play Sequencer with any LevelSequence
  3. Wait until the play bar reaches the last frame and the preview ends

expect : OnStopEvent and 1 event fire
result : does not fire

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-158921 in the post.

0
Login to Vote

Fixed
ComponentUE - Anim - Sequencer
Affects Versions5.0
Target Fix5.1
Fix Commit21061696
Main Commit21061696
CreatedJul 8, 2022
ResolvedJul 12, 2022
UpdatedJul 17, 2022