Trigger play button in main gui Timeline

Howdy,
I need to set up a simple switch (eg when a value of 0=on 1=off) in the comp that triggers the main timeline to play. Which I can use to ref a value coming anywhere, in this case via TDAbelton.

I am a bit of a noob with python script, so looking for a simple solution - any pointers on where I could look please.
Thank in adv!

Hi,

Without knowing too much about your project, I’d like to gently suggest that if you want to operate on the TD timeline, you leave the main (root) timeline running, and instead add a separate component with component time and drive that instead.

Stopping and starting the root timeline can meddle with the ability to cook various useful stuff.

Docs: Component Time

You can set any time component to play with python by setting the “play” property to True

https://docs.derivative.ca/TimeCOMP_Class

1 Like

Thanks heaps for that tip flowb!

To illustrate what I did based on your sage suggestion.

I right clicked on root ‘COMP’ and added ‘local’ time.

I add a ‘timeline’ op inside ‘comp’, and in ‘timeline Ref Op’ field I add the ‘local’ op.

I add the ‘timecode’ op and set ‘timeline’ op as timecode object.

When I open a floating network of the ‘local’ to reveal ‘time’ op I can see the ‘play’ field - when I change value 0-1 it starts/stops nicely.

So I can now connect any op that can send a 0-1 to this.

Hi,
I’m glad you got it working. If you’re ok with a little bit of python code, you can possibly simplify your setup by using a chop execute and using something like:

parent().time.play = bool(val)

I’ll attach an example.
CHOPtoCOMPPlay.toe (5.0 KB)

1 Like

Awesome!

I think it’s time I do some Python tutorials. As the elegance of it looks like a TD game changer.

Can you suggest links to any (specific to) TD Python workshops, channels or tutorials?

Note: Have checked ‘solution’ to your first response.

@raganmd has a really good python series for TouchDesigner on YouTube. https://youtube.com/playlist?list=PLs0WlHa1rf209Yir05SuEquDbAq2DGNjs&si=POuJMZ2Aci4P9bxM

Great, thanks Flowb!