Callback if timeline has reached the last frame

Hello,

Is there a callback I can get after the timeline has reached the end of the frame? I need to do actions based on that in code.

I did try to use CHOP timer.
Set its length type to frames and the number of frames equal to the number of frames in a custom Base Time. Playmode is sequential as this timer exists in another base node, different from the Base Time node where I can the frame count.
However, when I set the Base Time’s Frame to 1 and start playing the timeline and also start the chop timer, they get out of synch. CHOP Timer usually finishes after the Base Time has reached the end (final frame). So it lags behind for some reason.

Thank you!

you can use me.time.frame to get the current framenumber.

If you place this as an expression in the value of a Constant CHOP you can then use a CHOP Execute to do an action whenever value is higher than x

See example attached
frame_number.toe (3.89 KB)

Just be careful with monitoring me.time.frame for specific values.
If you’re set to realtime mode (default), it may skip ahead frames periodically to keep in sync with system clocks etc. So it could skip over the last frame before looping around to frame 1.

If this is the case then I would need something more reliable.

Is your timeline looping?

If you use a Logic CHOP, feeding it the current time (from a Timeline CHOP), you can generate a pulse whenever the value drops below 5 frames for example.
This will generate the pulse exactly once at each loop at the start.
But again, that timeslice will have an indeterminate amount of frames in it (usually 1), so it may go off on Frame 1, or it may be Frame 2, or Frame 3 etc.

Alternatively, did you try using ‘Locked to TimeLine’ mode in the Timer CHOP ?

Thanks, I will try this solution.

Can I lock the timer to a timeline different than the one the timer is located in? Reference it somehow?

EDIT: And how would I detect this pulse in code? Attach Chop Execute to logic?

The timer can only be locked to the timeline it is in unfortunately.
The TimeLine CHOP however can point to other components/time references.
A CHOP Execute would detect the drop in frame count from the Timeline and/or logic CHOPs.

[EDIT]
Whenever testing your networks for frame drops, its a good tip to add a Hog CHOP to force
it to drop frames.

Cheers