Referencing a CHOP in Ramp's DAT

Hi

I have an example touchdesigner project that i found where they are driving the RGB values of a Ramp by reference a CHOP in the Ramp’s DAT table. For example, one of the cells of the DAT table is:

`chop("null3/r")`

Simple enough - that cell will reference the “r” channel in “null3”.

However, when i go to do the same thing in one of my projects, the DAT table does not recognise that code at all. If my troubleshooting is accurate, its because the code I’m using from that other project is T Script and my Ramp is looking for Python.

Firstly is that assumption correct - and secondly if so, how do i either change it to read T Script, or how do i convert that code into Python it will understand?

Thanks in advance

Hi @stovbraid,

you have found some tscript :slight_smile:

To use expressions in DAT cells the data has to go through an Evaluate DAT to be interpreted. (The Evaluate DAT then needs to be referenced on the Ramp TOP)

Translating your mentioned expression is fairly straight forward:

# 'op' is a reference to an operator
# all channels of the referenced CHOP can be accessed via list syntax
op('null3')['r']

Something to be aware off: The Ramp’s definition DAT has a header with strings and those would cause an error as they’d be interpreted as python variables. To avoid this, turn the Exclude First Row parameter on the Evaluate’s Scope Parameter page on.

A nice overview of Python <> TScript equivalents can be found in the documentation here: Introduction to Python Tutorial - Derivative

Hope this helps
Best
Markus