Curriculum Navigator:
If you’re viewing this page from the TouchDesigner curriculum explorer, you can use the buttons below to interact with this topic.
Execute DATs (any of the DATs that has the word “Execute” in it) and “callbacks” (which are Text DATs with python code in them) have several similar structural elements. For example, the CHOP Execute DAT has a parameter to indicate which CHOP it is watching, a parameter to indicate which channels it is watching, and then several toggles for which behavior should trigger a Python function.
The text in the body of the DAT are Python functions that start with the keyword def (definition) followed by the function name. In the CHOP Execute DAT you’ll see definitions for each of the corresponding toggles in the DAT’s parameters. We can then write Python code in the CHOP Execute DAT that will run based on which conditions are met.
Callbacks are represented by a docked DAT (small purple box with a +) at the bottom of an operator. Callbacks typically have a set of functions that run based on the conditions that are described in the DAT.