Posts

creating local variables, eval dat, store, fetch, examine

 To create a variable that exists at a level & for it's children, we use a text DAT. Inside the DAT, type: me.parent().setVar('variablename', 34) now when you right click the text DAT and select run-script, it creates a little table that contains the variable + value to access this, eg in the radius of a circle, type: me.var('variablename') the circle's radius parameter will now be 34. This variable can be accessed by any nested children by typing the me.var('variablename') code If you make a variable inside one of the children (lets say it's a Base), the parent will NOT be able to access it. If you want a variable to have a changing value, eg. driven by a slider or LFO, you need to use an evaluate dat and a table. Go into the base that contains your variables. inbetween the table & null, add your evaluate dat & connect a blank table as the 2nd input. Give the blank table the correct dimensions & then make sure to recreate the "n

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

what is the eval DAT?

 The Eval DAT creates a table that adheres to some rules that you give it. The first input is typically a "dumb" table that has no expressions, it might just be a row of table labels like "position, x y z". The second input is a table with expressions. These are evaluated along the columns. You can enter information into each table using a text editor. The columns are separated by TABS. eg you would type: index TAB x TAB y TAB z to create 4 columns To make the eval dat use data from the dumb table you would type "me.inputCell" into the appropriate "cells" of the 2nd input table. You will most likely use expressions like (me.inputRow)/op('noise1').width op('noise1').sample(x=me.inputRow,y=0)[0] to create data. The first is taking the row number of the table and dividing it by the width parameter of an external noise node to get a fraction. The second is setting the cell value by sampling the rgb value of "noise1" at x,y a

cache cache select, getting frames from before

 To access frames in a video that have gone by, use a cache & cache select TOP. Eg. you want to blend "2 frames ago" with the current frame on your video. To your movie-file-in, attach a cache TOP. Next create a cache select TOP and specify the name of the cache TOP. Now in the parameter of the cache select type -2. blam!

setting the image alpha to 0

Quite often in Elektronnaut's videos, they add an RGB mix or a Transform TOP to add a black background. But what if you wanted to removed the background? The answer, kinda is to use a Channel Mix TOP node. In the parameters, set the Alpha to zero & it should set the alpha of the whole frame to zero & will often remove the background -depending on what you've been doing of course

convert string into a table of letters

 say you have a few words in a sentence or a bunch of words in a line (could be a very long line - I think this requires there to be no "returns" or "new lines" to work). Say you wanted to create a table of all the letters and spaces. This is one way to achieve it. Eg. Here are some words in a line. This might be displayed as a few lines because there are so many words, but there is no return or new line character. Your words will sit inside a text DAT, or some form of DAT. Lets say it's in a select DAT called "select1" Attach a Substitute DAT In the before parameter field, toggle the python option and enter: op('select1').text In the after field, enter : op('select1').text.replace("","/")[1:-1] The first bit of code is just taking your original text. The second is specifying what to replace, in our case it is putting a "/" after everything. The part in the square brackets is saying to start at the 1th lett

an on/off toggle switch with lag

  sort of picked this up from here - https://youtu.be/ZTqh5HKmya8?list=PLFrhecWXVn59Xtcy1L2vfSaqq2_Ts88ov Anyway - Make a keyboard-in Chop Connect it to a LOGIC Chop Change the Channel Pre-OP drop down parameter to Toggle Add a Lag Chop to this, tweak params as required. You now have a smooth toggle signal.