The Execute DAT lets you edit scripts and run them based on conditions. It can be executed at the start or end of every frame, or at the start or end of the TouchDesigner process. Text can be created in the DAT via the Node Viewer or an external text editor. Text can also can be passed into the Text DAT through the node's input, however this text will not be editable.
Execute DATs are created with default python method placeholders. For each monitored condition in the parameters, there is a matching python method in the DAT. When a condition is turned on in the parameters, each time that condition is satisfied the corresponding python method will be executed.
Parameters - Execute Page
active - While on, the DAT will respond to the events selected below.
executeloc - ⊞ - (Tscript only) Determines the location the script is run from.
- Current Node
current- (Tscript only) The script is executed from the current node location.
- This Node
here- The script is executed from the parent of the DAT. The DAT executes from the parent to make siblings of the DAT easy to access: DAT scripts used to execute from inside the DAT.
- Specified Operator
op- The script is executed from the operator specified in the From Operator parameter below.
fromop - This component is also the path that the script will be executed from if the Execute From parameter is set to Specified Operator.
start - The onStart() method is executed when TouchDesigner starts.
create - The create() method is executed when the node is created. This can be triggered on start, by loading a component from disk, by copying & pasting, or any other way a node can be created.
exit - The onExit() method is executed when the TouchDesigner process quits.
framestart - The onFrameStart() method is executed at the start of every frame.
frameend - The onFrameEnd() method is executed at the end of every frame.
Play State Change
playstatechange - The onPlayStateChange() method is executed each time the play state changes, ie. pause or play is used on the timeline.
devicechange - The onDeviceChange() method is executed each time devices are connected or disconnected from the computer. For example, plugging in MIDI devices, cameras, joysticks, etc.
NOTE: When using multiple Execute DATs with Start and Create functions, they are triggered in numbered-alphanumeric order of the DAT's names.
edit - Clicking this opens a text editor to edit text in the DAT.
TIP: To direct all "standard output" of python to a Text DAT, put this in the
sys.stdout = op('text1')
To safely to this and restore standard output:
prev = sys.stdout sys.stdout = op('text1') sys.stdout = prev
Parameters - Common Page
language - ⊞ - Select how the DAT decides which script language to operate on.
input- The DAT uses the inputs script language.
node- The DAT uses it's own script language.
extension - ⊞ - Select the file extension this DAT should expose to external editors.
dat- various common file extensions.
- From Language
language- pick extension from DATs script language.
- Custom Extension
custom- Specify a custom extension.
customext - Specifiy the custom extension.
wordwrap - ⊞ - Enable Word Wrap for Node Display.
input- The DAT uses the inputs setting.
on- Turn on Word Wrap.
off- Turn off Word Wrap.
- Input 0 -
Info CHOP Channels
Extra Information for the Execute DAT can be accessed via an Info CHOP.
Common DAT Info Channels
- num_rows - Number of rows in this DAT.
- num_cols - Number of columns in this DAT.
Common Operator Info Channels
- total_cooks - Number of times the operator has cooked since the process started.
- cook_time - Duration of the last cook in milliseconds.
- cook_frame - Frame number when this operator was last cooked relative to the component timeline.
- cook_abs_frame - Frame number when this operator was last cooked relative to the absolute time.
- cook_start_time - Time in milliseconds at which the operator started cooking in the frame it was cooked.
- cook_end_time - Time in milliseconds at which the operator finished cooking in the frame it was cooked.
- cooked_this_frame - 1 if operator was cooked this frame.
- warnings - Number of warnings in this operator if any.
- errors - Number of errors in this operator if any.
|• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •|