DAT Execute DAT

From TouchDesigner 099 Wiki

Summary

The DAT Execute DAT monitors another DAT's contents and runs a script when those contents change. The other DAT is usually a table.

DAT 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.

PythonIcon.png datexecuteDAT_Class

Parameters

Active /active - While on, the DAT will respond to the CHOP that is referenced.

Execute From /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.

From Operator /from - The path that the script will be executed from if the Execute From parameter is set to Specified Operator.

DAT /dat - The DAT which is monitored and will trigger the script to execute when its contents change.

DAT Execute Conditions - Specify what changes to the DAT to monitor.

  • Table Change - The onTableChange() method is called if the table changes in any way since the last cook.
  • Row Change - The onRowChange() method is called once for every row that changed (since its last cook).
  • Column Change - The onColChange() method is called once for every column that changed (since its last cook).
  • Cell Change - The onCellChange() method is called for every cell that changed since the last cook.
  • Size Change - The onSizeChange() method is called for every table size change since the last cook.

Execute /execute - Determines if the methods are executed at teh start of the frame or end of the frame.

  • Start of Frame - the method will be called from the start of the frame. If a row changes 4 times during a frame then the method will run 4 times as well (useful for Multi Touch In DAT events for example).
  • End of Frame - the method will execute at most one time per frame, at the end of the frame, even if it triggered several times in one frame. If, for example, Monitor is set to Row, a row may change several times in a frame, but it will be called only once for each row.

Edit... button /edit - Clicking this opens a text editor to edit text in the DAT.

Using Tscript Mode

Put the command echo $args in the script to show what values are passed to the script from the changing DAT.

You can specify how the script is triggered using the Monitor parameter:

  • Table - If the table changes in any way since the last cook - this was the original "classic" behavior. In Tscript arguments passed to script are: script_fullpath fullpath_of_table
  • Row - The script is called once for every row that changed (since its last cook). In Tscript arguments passed to script are: script_fullpath table_fullpath change_index total_changes row_number
  • Column - The script is called once for every column that changed (since its last cook). In Tscript arguments passed to script are: script_fullpath table_fullpath change_index total_changes column_number
  • Cell - The script is called for every cell that changed since the last cook. In Tscript arguments passed to script are: script_fullpath table_fullpath change_index total_changes row_number column_number new_value old_value

where script_fullpath is $arg0.