Placing a specific element randomly in the timeline
-
I want a sound effect to be placed randomly on each render. What’s the best way to do this?
For example:
Video 1: 15th second
Video 2: 48th second
Video 3: 30th secondetc.
-
Hmmmm. This could be a bit tricky as this use case would be relatively uncommon in After Effects. However, I can think of a couple of methods we might use to achieve the desired result.
The first wouldn’t be a “true” randomization and would require some generation of placeholder assets, but the upside is that it would be relatively simple. For this method, we’d want to generate several “dummy” clips of various lengths that contained no audio or video. These files could then be used in conjunction with Templater’s Time Sculpting feature to determine the placement of our random audio clip.
So, for example, we could create clips that were 15, 48, and 50 seconds long. We could then set the audio clip to start and the endpoint of the “dummy” clip. This would allow us to move the audio clip in a relatively straightforward fashion using Templater’s Time Sculpting feature. The downside to this method is that, depending on how much granularity was needed, it would require quite a few “dummy” clips to be generated. It would also require some sort of mechanism to randomly designate a dummy clip for each Job that we wanted to create. We might be able to accomplish that with a Google App Script for Google Sheets or a Zapier process if we’re using QUE.
The other method would be a “true” randomization, but it would require Templater Bot and the use of the Event Scripts feature. Event Scripts allow users to create After Effects ExtendScripts that can be run at various points throughout the Templater process.
With that in mind, it should be possible to create a script that adjusts the inPoint of the audio layer to a value generated using Math.random(). This would give us a “true” randomization for the inPoint of the layer but might be a bit more challenging to set up, depending on your familiarization with AE’s ExtendScript language.
Hopefully that helps, but if you have any other questions, please feel free to let us know.
Thanks,
Jeff