Hi,
I’m just curious as for the reasoning with this source code dealing with “Jump To End” in Sequencer.
Why does UE want to calculate a one frame offset from the end when i jump to the end it seems counterintuitive.
For example if i have a 150 frame sequence and press ‘Jump To End’ why does it take me to frame 149 and not frame 150?
FReply FSequencer::OnJumpToEnd()
{
SetPlaybackStatus(EMovieScenePlayerStatus::Stepping);
const bool bInsetDisplayFrame = ScrubStyle == ESequencerScrubberStyle::FrameBlock && Settings->GetSnapPlayTimeToInterval() && Settings->GetIsSnapEnabled();
FFrameRate LocalResolution = GetFocusedTickResolution();
FFrameRate DisplayRate = GetFocusedDisplayRate();
// Calculate an offset from the end to go to. If they have snapping on (and the scrub style is a block) the last valid frame is represented as one
// whole display rate frame before the end, otherwise we just subtract a single frame which matches the behavior of hitting play and letting it run to the end.
FFrameTime OneFrame = bInsetDisplayFrame ? FFrameRate::TransformTime(FFrameTime(1), DisplayRate, LocalResolution) : FFrameTime(1);
FFrameTime NewTime = UE::MovieScene::DiscreteExclusiveUpper(GetTimeBounds()) - OneFrame;
SetLocalTime(NewTime, ESnapTimeMode::STM_None);
return FReply::Handled();
}
Thanks