How to execute code when timeline is paused?

Hi,

I would like to execute some code (Execute DAT) only when the timeline is paused.

I want to send data to another app which need to receive data continuously or it declares me as disconnected. So it will be great TD send a permanent “default” value when in paused state, waiting for the “real” values to be sent when playing timeline.

Thanks for your help!

You can see whether TD is playing with the timelineCHOP, Play channel. To react to that properly when TD is paused, you probably need to set up a COMP with independent time wherever you’re sending the value from. See Component Time - Derivative. As an alternative to independent time, you could react to the timeline stopping in a script and set up a repeating
run("<python function that sends data and calls this command again if timeline is still stopped>", delayFrames=1, delayRef=op.TDResources)

Thank you Ivan!
I will try this as soon as possible.