I am new to Touchdesigner, and I would like to know if anyone can help me resolve a question that I am unable to answer…
In a list of CHOP channels, I want to extract only the names of channels that have a value greater than zero and display them in the text parameter of a TOP. In the case of the attached photo, the Text TOP should print ‘cs’ and ‘d’.
I am trying to do this with a CHOP execute, but I can’t get those values to pass to the Text TOP.
I would really appreciate it if someone could help me.
def onValueChange(channel: Channel, sampleIndex: int, val: float, prev: float):
c = op(‘constant1’)
result = ‘’
for i in range (0,c.numChans):
if i == 0:
if c[i] != 0:
result += c[i].name
else:
if c[i] != 0:
result += ‘,’ + c[i].name
op(‘text1’).par.text = result
return