Parameter Execute DAT

From TouchDesigner 099 Wiki

Summary

The Parameter Execute DAT runs a script when a parameter of any operator changes state. There are 4 ways a parameter can trigger the script: if its value, expression, export, or enable state changes.

Parameter Execute DATs are created with default python method placeholders. Unlike other execute DATs, the Parameter Execute DAT does not cook the node that it is watching, to avoid issues with recursive updates.


PythonIcon.png parameterexecuteDAT_Class

Parameters

Active /active - While on, the DAT will respond to the Parameter 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 - This operator is also the path that the script will be executed from if the Execute From parameter is set to Specified Operator.

OP /op - Specify which operator the triggering parameter belongs to.

Parameter /parm - Specify which parameter to monitor for triggering the script.

Value Change /valuechange - The onValueChange() method executes when the parameter specified changes value in any way. It is called once each frame.

Expression Change /expressionchange - The onExpressionChange() method executes whenever the specified parameter's expression changes. For example, changing the expression from me.time.frame to me.time.seconds will trigger the script.

Export Change /exportchange - The onExportChange() method executes if the export path to the specified parameter changes. For example, if the parameter is being exported to from /chopname/chan1 and that is changed so /chopname2/chan2 is now exporting to it, then the script will be triggered.

Enable Change /enablechange - The onEnableChange() method executes if the specified parameter goes from being disabled to enabled.

Mode Change /modechange - The onModeChange() method executes if the specified parameter goes from being disabled to enabled.

Custom button /custom - Monitor Custom Parameters..

Built-In button /builtin - Monitor Built-In parameters.

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

Using Tscript Mode

Arguments are passed to the script to describe what type of change was detected. In Tscript you can view the arguments by including the command echo $args in the script.