I work with a lot of hand-drawn loops and I'm curious about expressions that can randomize the frame playback of image sequences using the time-remapping property.
For example, in traditional hand-drawn animation when you wanted to hold a pose without the animation looking static you would create what's called a traceback, which means you would physically trace at least 8 frames of the same drawing and then shoot them over and over again in a random order for however long you needed to hold the pose. That way you don't get the exact same pattern of frames cycling over and over like you would if you just looped it.
Of course you can manually reorder frames in After Effects, but it's very time-consuming and I'm wondering if an expression could be written that could easily be modified for different sequences at different timings and different lengths. For instance, I found this expression by Filip Vandueren on the Creative Cow website http://forums.creativecow.net/thread/227/12413 It was intended to randomize a 5 frame sequence, however the sequence and the comp have to be at the same frame-rate in order for it to work. Therefore, I have to work at a 12fps sequence in a 12fps comp if I want the animation to look like it was shot on 2s. Usually a 12fps sequence with no time remap expressions will play back on 2s if it's in a 24fps comp and as far as I can tell using time stretch or posterize time doesn't work. Time stretch does nothing and posterize time crashes after effects when I add it to the image squence with the expression applied to the time-remapping property. This probably has something to do with an expressions conflict that happens once time remapping is applied to the image sequence. Anyhow, I'm asking if there's a way to modify this expression so that I could put my footage into a comp at another frame rate and use the expression itself to tell it to play at either 8fps, 12fps or any other frame rate.
This is Filip Vandueren's expression
seedRandom(1,true);
var t=timeToFrames();
var r1=-3;
var r2=-2;
var r3=-1;
for (var i=0;t>=i; i++) {
var r3=Math.floor(random(5));
if (r1==r3 || r2==r3) {
t++;
continue;
}
r1=r2;
r2=r3;
}
framesToTime(r3);
This is an expression based on Vandueren's that I tried to modify for an 8 frame image sequence. It sort of worked but it didn't really achieve what I was looking for.
timeRemap
seedRandom(2,true);
var t=timeToFrames();
var r1=-6;
var r2=-5;
var r3=-4;
var r4=-3;
var r5=-2;
var r6=-1;
for (var i=0;t>=i; i++) {
var r3=Math.floor(random(8));
if (r1==r3 || r2==r3) {
t++;
continue;
}
r1=r2;
r2=r3;
}
framesToTime(r3);
The image sequence played all 8 frames randomly without duplicating them, but I still couldn't figure out how to make it play at 8fps or 12fps without conforming the comp frame rate to the frame rate of the image sequence. Ideally I'd like the expression to determine the frame rate so that I can have it in a comp with other frame rates and not have to worry about disturbing the expression.
Reordering random frames is a common thing for 2D animators to do so I'll also file a feature request asking After Effects to add this feature to an existing plug-in or create a standalone plug-in.