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's file field, do the usual op('images'....) BUT now we have [me.digits] instead of [0,0] eg - op('images'[me.digits,0] The me.digits is using the numbers in the node's name to access the row of the table
  • Back to the Replicator, type in "file" for the Operator Prefix, this is what the created nodes will be called
  • Drag your File0 node onto the Master Operator field
  • You should now have however many images that were in your folder preloaded as movie-ins. called file1,file2,file3,etc.
  • Go up a level, outside of the Base comp.
  • Create a Select Top, this will be accessing the Base comp's "file" nodes.
  • In the expression field type -
    "images/file" + str( int( op('index')[0])))
  • the " " is specifying the images/file part as a string. The + is appending the next part to the string. We are converting the int value of the "index" to a string. Basically we have a path to file1, file6 whatever the index specifies.

Comments

Popular posts from this blog

what is the eval DAT?

Random value selector (int)

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