Time Mismatch of Sequence-based Camera Shake in Sequencer

Summary

I have a Camera Animation Sequence whose playrange starts from 30 frame and ends in 100 frames. When I played it in Sequencer with Camera Shake using Sequence Camera Shake Pattern, nothing happened in first 30 frames, and the animation started after that. There is a 30-frame-delta. Besides, the animation stopped playing after the 70th frame.

What Type of Bug are you experiencing?

Animation

Steps to Reproduce

  1. Create a Camera Animation Sequence, make some animation in it and set the start of playrange any frame rather than 0.
  2. Create a Camera Shake, make it use Sequence Camera Shake Pattern and set the sequence it refers to be the one we produce in step 1.
  3. Put the Camera Shake in a new Sequence.

Expected Result

The Camera Shake should play the animation from start to end.

Observed Result

The Camera Shake play the animation from 0 frame of the Camera Animation Sequence and stop in the frame which number is the animation duration.

Affects Versions

5.5

Platform(s)

Windows

Additional Notes

void USequenceCameraShakePattern::ScrubShakePatternImpl(const FCameraShakePatternScrubParams& Params, FCameraShakePatternUpdateResult& OutResult)
{
	const float BlendWeight = State.Scrub(Params.AbsoluteTime);
	if (State.IsPlaying())
	{
		if (Player->GetPlaybackStatus() != EMovieScenePlayerStatus::Playing)
		{
			Player->Play(bRandomSegment, bRandomSegment);
		}

		const FFrameRate InputRate = Player->GetInputRate();
		const FFrameTime NewPosition = Params.AbsoluteTime * PlayRate * InputRate;
		UpdateCamera(NewPosition, Params.POV, OutResult);

		OutResult.ApplyScale(BlendWeight);
	}

I think the NewPosition here should be Params.AbsoluteTime * PlayRate * InputRate + Player->GetStartFrame().
Besides, in void UCameraAnimationSequencePlayer::Update(FFrameTime NewPosition):

	if (bDurationRequiresLooping)
	{
		// If we are only looping a fixed number of times to meet a certain duration override,
		// we need to check here whether we have reached the end.
		const FFrameTime ElapsedPlayedFrames = (LoopsPlayed * DurationFrames) + NewPosition;
		if (ElapsedPlayedFrames >= TotalDurationFrames)
		{
			bShouldStop = true;
		}
	}

TotalDurationFrames should also plus GetStartFrame().