Posts

Showing posts with the label execute

Rollover effect, panel chop, image selector, containers, dat execute, panel execute, strings, ifs, renderpick and instances

Finally got through most of the Elektronaut vids, so working through some of the Matthew Ragan tuts now. Here are two really good ones demoing two different ways of making a UI that allows you to select an image from a 3x3 grid and display it in a larger window/panel.  https://matthewragan.com/2015/03/29/thp-494-598-image-selector-container-method-touchdesigner/  https://matthewragan.com/2015/03/29/thp-494-598-image-selector-instance-method-touchdesigner/   Some key points that I think are good things to note - Containers are panel types of objects that can be finicky to arrange! However, you can utilise the PANEL CHOP within a container to great advantage - attributes such as "inside" or "rollover" can be used to dim the panel's opacity for example, or maybe a texture TOP that is somewhere. Containers are a bit limited in terms of how you can position them (with any great speed). You're more or less limited to rows and columns, unless you get a little creat...

using the CHOP EXECUTE DAT node - VALUE CHANGE

 Will make other posts as I learn how to use the other bits! use case - say you have a Count CHOP and wish to execute a set of instructions everytime the value changes, the CHOP Execute DAT node is what you want! Eg, take values from a NOISE and apply them to a TRANSFORM, everytime the Count changes value. This is a bit like sample/hold of random values. Create the CHOP EXECUTE DAT. Next type in the name of your Count node in the CHOPs box The part we're interested in is this segment of code- def onValueChange(channel, sampleIndex, val, prev):     return We can delete everything above that! Also make sure on the Chop Execute, that "Value Change" is set to ON. so after the colon, we can make some variables (this is for clarity, not necessary) def onValueChange(channel, sampleIndex, val, prev):          source=op('NOISE')     target=op('TRANSFORM')              target.par.tx=sourc...