DAT to CHOP

From TouchDesigner 099 Wiki

Summary

The DAT to CHOP will create a set of CHOP channels with values derived from a DAT.

PythonIcon.png dattoCHOP_Class

Parameters - DAT to Page

DAT /dat - The DAT to be used to retrieve values. This DAT should be in table format. For table format, use either a Table DAT or a Convert DAT set to To Table.

Select Rows /extractrows - This parameter allows you to pick different ways of specifying the rows selected.

  • All - All rows selected.
  • by Name - Rows selected using Start Row Name and End Row Name parameters.
  • by Index - Rows selected using Start Row Index and End Row Index parameters.
  • by Start Name, End Index - Rows selected using Start Row Name and End Row Index parameters.
  • by Start Index, End Name - Rows selected using Start Row Index and End Row Name parameters.
  • by Values - Rows selected by specifying the row values explicitly.
  • by Condition - Rows selected by an expression to be evaluated for the from column.

Start Row Name /rownamestart - Specify the row name to start the selection range from.

Start Row Index /rowindexstart - Specify the row index to start the selection range from.

End Row Name /rownameend - Specify the row name to end the selection range.

End Row Index/rowindexend - Specify the row index to end the selection range.

Row Select Values /rownames - Specify actual row names that you want to select. You can use pattern matching, for example row[1-4] will select all the rows names row1 thru row4.

Row Select Condition /rowexpr - Specify an expression that will be evaluated. If the expression evaluates to true, the row will be selected.

Expand the parameter and you will see that it is in expression mode.

SelectDAT rowselectexpr.png

By default, the Python expression is re.match('.*',me.inputCell.val) != None. '.*' means match any character multiple times, so this expression matches all values. If you want to match the parent's operator name followed by any numeric number you can use me.parent().name+'[0-9]*', where '[0-9]*' matches any numerical string. '.*'+parent().name+'.*' will match any cell that contains the operator's parent name. You can check Regular Expression Operations for additional information on how to use the Python Regular Expression module.

In Tscript, you can access the cell value with the local variable $V, and the row and column with $R and $C

From Column /fromcol - When selecting rows by values, this parameter selects which column to use when matching cell values to Selected Row Values to determine which rows are selected.


Select Cols /Select cols - This parameter allows you to pick different ways of specifying the columns selected.

  • All - All columns selected.
  • by Name - Columns selected using Start Col Name and End Col Name parameters.
  • by Index - Columns selected using Start Col Index and End Col Index parameters.
  • by Start Name, End Index - Columns selected using Start Col Name and End Col Index parameters.
  • by Start Index, End Name - Columns selected using Start Col Index and End Col Name parameters.
  • by Values - Columns selected by specifying the column values explicitly.
  • by Condition - Rows selected by an expression to be evaluated for the from row.

Start Col Name /colnamestart - Specify the column name to start the selection range from.

Start Col Index /colindexstart - Specify the column index to start the selection range from.

End Col Name /colnameend - Specify the column name to end the selection range.

End Col Index /colindexend - Specify the column index to end the selection range.

Col Select Values /colnames - Specify actual column names that you want to select. You can use pattern matching, for example colvalue[1-4] will select all the columns named colvalue1 thru colvalue4.

Col Select Condition /colexpr - Specify an expression that will be evaluated. If the expression evaluates to true, the column will be selected. See Row Select Condition for more details.

From Row /fromrow - When extracting columns by Specified Names, this parameter selects which row to use when matching cell values to Selected Col Values to determine which columns are selected.


Output /output - Specify the form of the channels output.

  • Single Channel - A single channel is created with one sample for every value extracted.
  • Channel Per Row - A separate channel is created for every row extracted.
  • Channel Per Column - A separate channel is created for every column extracted.
  • Channel Per Value - A separate channel is created for every value extracted.

Channel Names /names - Specifies how the channels are named.

  • Automatic - Channels are prefixed 'chan'.
  • From Row Index - Channel names are derived from a single row of the table, specified by the Index parameter.
  • From Row Name - Channel names are derived from a single row of the table, specified by the Name parameter.
  • From Column Index - Channel names are derived from a single column of the table, specified by the Index parameter.
  • From Column Name - Channel names are derived from a single column of the table, specified by the Name parameter.

First Row is /firstrow - Specifies whether the first row is ignored, names, or values.

First Column is /firstcol - Specifies whether the first columnn is ignored, names, or values

Standard Options and Local Variables

None