When I open my project in touchdesigner, it’s already playing and starts on or around frame 519, which causes my animations to not play properly.
I searched the forums and found that if I make an execute DAT and add “app.power = False” to the start() it should start with the power turned off.
def start():
a = op(‘text1’)
a.text = 'Your thing was \nstarted on frame: ’ + str(me.time.frame) #frame 519
app.power = False #does nothing
return
This does not work.
If there is not a way to start TD paused or powered off, is there a way to at least make sure it starts on frame 1 without having to pause and rewind the timeline?
There are a handful of bits that happen on start up that often use frame counts to help get things rolling - if you’re using any pre-filled texture3Ds or cache TOPs these use frame counts to fill up their textures.
Don’t forget to flip on the flag on your execute DAT to fire events on start, the following set of scripts should stop the timeline and set the current frame to 1:
op( 'local/time' ).play = 0
op( 'local/time' ).frame = 1
Hmm I must still be doing something wrong. The execute DAT has Active and Start toggled on. But when I add the two lines you provided to the start() block I receive the following error:
File “/project1/execute1”, line 9, in start
AttributeError: ‘NoneType’ object has no attribute ‘play’ (/project1/execute1)
if I change ‘local/time’ to ‘/local/time’ I no longer receive an error, but the timeline still plays on startup. Although it does now actually start on frame 1, so that’s good news.
Good catch with the path there!
The other trick you might use is to delay this block. You can do that with the run() method. For example:
run( "op( '/local/time' ).play = 0", delayFrames = 60 )
Again, there are a handful of bits that rely on the timeline to be running in order for proper start up. Are you starting in perform mode or in the network editor?
Currently I am starting in the network editor, the same problem occurs if I start in perform mode as well.
The delay seems to do the trick though, it does briefly play some audio and animations for those 60 frames before resetting but I think I can work around that.
Thanks for your help! 