Hi folks,
I’m currently working on a system that allows the player to “scrub” through a Timeline. I’m using an approach similar to what’s described here.
I’m now encountering a problem where Timeline events are only fired when time is increasing. When time is decreasing, the events are not fired. This behavior makes sense, but for my purposes, I need to make sure the markers are notifying the Receiver when moving backwards through the timeline as well.
My initial approach was to create a system following the same approach as the ClipNotification example shown in the TimelineMarkerCustomization example project, but I’m realizing this would not allow for “retroactive” firing of events, when the player moves through the timeline really quickly, skipping over certain events.
TLDR; is there a way of extending the Signal system to check for Reactions to invoke retroactively, when time is decreasing?
There isn’t a way to do in the general case. But if, you can live with a limitation of it only working with a custom track, you can always create your own track mixer playable that does this for you.
The playable mixer could (inside PrepareFrame or ProcessFrame)
keep a list of Signal/Markers/INotifications.
get the Timeline time (playable.GetGraph().GetRootPlayable(0).GetTime())
compare that to marker time and fire notifications if the time has crossed the time point going backwards.
You can push a notification using the PlayableOutput.PushNotification, and the playable output is available from the FrameInfo data passed to the script.
The catch is if you use signals (or any marker that implements INotification) then timeline will automatically apply the default playable to fire notifications, so you will have two playables firing notifications.
Ah interesting, thanks for the link! I ended up needing to set some data on the track anyhow (to simulate a “retroactive” effect on the Marker that’s just before the one that fired), so having a clip on it ended up being useful in the end actually.
The hardest part to figure out was actually the gathering of the Markers, but once that was figured out, I managed to implement something fairly quickly.