Idle movie -> random movie -> back to Idle movie

Subject: Help with Controlling Movie Playback in TouchDesigner Based on Random Trigger

Hi,

I’m working on a projection for a Santa Claus house, where a closed curtain animation loops when idle. When a child posts a letter in Santa’s mailbox, a sensor is triggered and sends a USB signal, which generates a random number between 1 and 5. I receive this number through a Serial CHOP, and this part works perfectly.

The number then triggers one of five corresponding movies through a Switch TOP, where the five movies are connected. However, I’m facing two issues:

  1. The triggered movie starts playing from its current time location instead of from the beginning.
  2. The movie should play only once and then switch back to the idle movie (index number 0 in the Switch TOP).

I can’t figure out how to achieve these two steps. Does anyone have suggestions or solutions for this? Any help would be greatly appreciated!

Thanks in advance!

I would make use of a timerCHOP in combination with the new timecode and mediafileinfoDAT like this:
Use the mediafileinfo to know the length of the VideoFile. Refference these values with the timerCHOP.
Feed the TimerCHOP in to a timeCodeCHOP and then refference the timecodeCHOP in the movieFileIn.
You can now Start the timerCHOP by pulsing start and with the Done-Channel and the cycleEndAlter Callback you can create some nice states.

You can also look in to finite stateMashine like Bananamash to create central handler for this beavhour.

Okay,
I’ll try this.
Thanks!