i am completely new to touchdesigner (a couple of days new) and am currently working my way through the tutorials and guides online, but one thing im failing to see (which i would have expected to see by now) is how to trigger events when the timeline hits a certain point.
the way i understand it is that touchdesigner does not focus on a timeline method like most video editors do, but on an information input method, but there must be a simple way to reference the timeline so that once it hits a certain point an event happens.
i have worked my way through the first noob tutorial videos and i am working my way through some other videos too and still havent seen this. is there a guide on how to do this somewhere? or can somebody please explain it?
Not many people use the timeline in production. What are you trying to do that youād like to use the timeline for? There may be a more TouchDesigner-friendly way of doing that same thing.
The timer chop might fit your needs.
Try looking at Help->Operator Snippets, timer chop, example 7. You could extend the example by selecting the message row of the info dat. Have a dat execute look at the selected row for when the table changes. That will allow you to execute a script every time the table changes.
i am more investigating out of curiosity at this stage, however i do see a lot of my future needs relying on a timeline.
i didnāt know those snippets were there, theyāre great! iām going to examine those closely.
i see what that example is saying, and the description does seem to be what iām looking for, but mine doesnt seem to work it stays at ārevving upā if the timeline is playing back or not. i assume those values are seconds? i ran it for 20 seconds.
For this issue, in the top right corner of the operator parameters is a little blue and yellow Python logo, if you click it, itāll turn into a āTā which means the operator is in Tscript mode and will except things like $F and the expression above.
Timer CHOP would be reliable and easy thing to get frame numbers from and use that as your ātimelineā. Also, you can create a local time component instead of hooking onto the master one, Iām not sure if there are any good examples of that around, worth doing a search for. I generally go the Timer CHOP route.
As a side note, usually itās never good to check exact frame numbers to trigger an action. Place a hog chop in to simulate dropping frames, and that expression might never evaluate to true, unless the realtime flag is off.
Regarding the timer chop, for that particular example I mentioned, to start it you would need to click to click the timer7 start button.
i was just building on the idea then realised that it wasnāt always firing, then i noticed my true frame rate was much lower than my set rate. i came here to ask if that was why and you had already mentioned it
i found that setting the == part of the code to >= sorted the problem, but this means i will need to process further if i need the pulse to return to zero, which is not a problem, i can use a trigger to hold the value for 1 frame.
as for the timer example. now i see how it works and i can easily adjust these values to use the timeline by changing the timers play mode to ālock to timelineā.
Generally it is best to avoid running any sort of python evaluation every frame - ie. checking for specific frames or conditions, operator references, etc. Rather, it is best to try to either script what is necessary on startup of sequence - or be CHOPing - as CHOPS are quite fast in relation to python. On small networks these performance benefits will be somewhat insignificant, but as you begin to program large networks these will mostly be your first step towards optimization.
In regards to the timeline - be careful with local timelines as they can become somewhat hairy to keep inline with your the master timeline and can produce unexpected results. I even avoid using the master timeline and prefer keeping my ātimelineā isolated in a Timer CHOP or a Speed CHOP. These give you precise control over triggering events as well as easy ability to āforkā out and control your entire network.
One method I often use for triggering sequences is a Speed CHOP ā Logic CHOP set to āOff When Outside Boundsā - this will produce a 1 when the speed value is inside the set boundaries and a 0 when outside the set boundaries. This is much quicker than python evaluation and is easy to CHOP out across the network. Likewise, you donāt run the risk of non-evaluation if you skip a frame.
Attached is a super simple example using a Speed CHOP ā Logic CHOP to fork out control to the network. speed_logic_trigger.tox (1.43 KB)
On advantage is that you donāt have to wrestle with the Timeline (playbar and component time etc) to control it if you use a Timer CHOP, you can control it free form and start and stop its playback at any time. Besides that the Timer CHOP has dozens of things to monitor and fire off triggers (including python callbacks) whereas using the Timeline CHOP is just bareones and youāll need to build all this triggering action yourself.
I would use the Timer CHOP wherever I can over the Timeline CHOP right now.