Posts

Showing posts with the label int

using the replicator to preload a bunch of images

Use case - you need to preload a bunch of high-res images and then randomly load them into a movie-file-in TOP. (if you just load them straight from a Folder DAT, there might be some lag) Create your Folder DAT as usual, I like to connect a select DAT to this, to trim the irrelevant rows and columns. Make a CHOP thing that can be used to select a number, like a COUNT, call it "index" (we'll use it later) Make a Base Comp (call it something like "images") and inside this, create an IN DAT. Go back up a level and connect your Select DAT to the Base Comp. The Replicator creates a lot (depending on your folder) of nodes, so we use it to keep things tidy. Back inside "images", attach a null to the IN and label it "files" Create a Replicator comp (not attaching it to anything yet) drag over or type in "files" into the Template DAT Table field Create a MovieFileIN TOP, name it "file0" <-that's a zero In this MovieFileIn...

selecting a row from a table, using op...

 use case - you have a table in form of the FOLDER DAT, you want to pick from the rows of the table. Lets say they're a list of images. First, lets get rid of the first column, which just lists the filenames. We need the second column that displays a full path. Use a DAT Select node for this. Choose select Rows by Index, set appropriate last number & Columns also by Index (start and end will both be 1). In the MOVIEFILEIN node, you could type - op('NAME')[0,0] to access the image in the first row. However if you want to do something a bit clever and use a CHOP named "INDEX", for example as the number to select the row, you can't just type - op('NAME')[op('INDEX')[0],0]   <THIS WON'T WORK. And Touch Designer won't say why... op('NAME')[int(op('INDEX')[0]),0]  <You have to change the data type to an int!  so, by casting to an INT, the op('....') blabla works.