Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Consolidate Multiple CHOP Execute DATs

General discussion about anything TouchDesigner

Consolidate Multiple CHOP Execute DATs

Postby chris1144 » Fri Aug 09, 2019 12:50 pm

I've been developing a UI with different controls. Toggles, Momentary buttons, sliders etc. The UI generates different ranges of values to calibrate and control a series of motors. At the moment each UI element's value is merged and passed in the network to a select CHOP. Currently there is a CHOP Execute DAT for each channel of the merged UI. Individual CHOP Execute DATs per function seems clunky. Although they only cook when activated, it just seems redundant. Is there a way to use a single CHOP Execute DAT and reference the channel name by in python to execute a command only when that CHOP value is updated/off-to-on/etc. ?

A simplified project file is attached.
Attachments
Multiple CHOP Execute DATs.toe
(4.61 KiB) Downloaded 24 times
chris1144
 
Posts: 19
Joined: Tue Oct 29, 2013 6:17 pm
Location: Brooklyn, New York

Re: Consolidate Multiple CHOP Execute DATs

Postby ben » Fri Aug 09, 2019 5:37 pm

Yes, you can just use the 'channel' object that is passed in to the function;
Code: Select all
def onOffToOn(channel, sampleIndex, val, prev):
   if channel.name == 'toggle':
      print(val)   
   return
User avatar
ben
Staff
 
Posts: 2599
Joined: Thu Nov 08, 2007 6:55 pm
Location: Toronto

Re: Consolidate Multiple CHOP Execute DATs

Postby chris1144 » Tue Aug 13, 2019 1:15 pm

Thanks Ben!
chris1144
 
Posts: 19
Joined: Tue Oct 29, 2013 6:17 pm
Location: Brooklyn, New York


Return to General TouchDesigner Discussion

Who is online

Users browsing this forum: Bing [Bot] and 20 guests