a random movie / image player

Hi,

here is a maybe useful component which plays in random order movies from a folder and transitions between them with a simple swipe.

To specify a folder other than the default Map location, create a Table DAT with 2 columns:
First Column enter:

folder

Second column enter the path to the movie files:

c:/my movie folder/movies

To start playback, click on the active container “movieShow”.
The playback logic is done in 3 scripts:

“pickNew” will select a new movie to play from the folderlist and preloads it.
after 15 frames, “startPlay” is run which initiates playback and starts the transition and calculates when the next movie should start loading.
After the transition is done, “unload” is run which will unload the last movie and loop back to “pickNew”

Hope this is of some help to everyone.

cheers
Markus
movieShow.tox (5.28 KB)

Hey Markus,
This is awesome, thanks for sharing!!

Is ‘macroDict’ just a variable in the “pickNew” script or is it part of a module that I’m overlooking?

Again, thanks!
Brain.

Hi Brian,

macroDict is a local Dictonary which I’m declaring as an empty dictonary with:

macroDict = {}

Further down in the script I fill it with some values:

macroDict['current'] = currentMovie
macroDict['next'] = nextMovie
macroDict['nextID'] = next

and finally pass it on to the next script as an argument:

op('startPlay').run(macroDict,delayFrames=14,group=parent().name)

This way in the startPlay script I can access and change named values which I find easier than passing them as separate arguments.

Hope this helps
cheers
Markus

Hey Markus,

I am student learning TouchDesigner for an installation project.

The project is a pandoras box, where each time the user opens the box, a random movie projection should play.

I am trying to simplify down your code, and just have a random film play every time my ‘switch’ via arduino serial in is triggered.

I am very new to Touch, and hope you might be able to provide some assistance in tweaking your component to do what I need it to.

Regards,

Darius Dias