-
Time Remapping: Loop with Ping-Pong but also progress forward
I’m looking to have a clip play to a specific pattern of 3 frames forward, 2 frames back, 3 forward, 2 back, etc. so that the net gain in frames forward is actually only 1 for every 5 frames. (You could also look at it this way: the footage plays normally for 1 frame, then ping-pongs for 4 frames [2 forward, 2 back]). My composition’s framerate is 23.976.
Here’s a chart to help you visualize what I’m trying to accomplish:
TIME (in frames)(1/23.976 seconds) > Frame # from original footage
0 > 0
1 > 1
2 > 2
3 > 3
4 > 25 > 1
6 > 2
7 > 3
8 > 4
9 > 310 > 2
11 > 3
12 > 4
13 > 5
14 > 4I’d like to use an Expression to create this effect. The pattern follows a series of 5: a, b, c, d, c. Then 1 is added to all values, and the pattern repeats. So I created the following Expression:
timeToFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false); //converts timecode to integer in frames
var a = 0;
var b = 1;
var c = 2;
var d = 3;
var s = 0; //s represents the # of the frame from the original footage
var g; //g will be the # of the frame from the original footage converted back to timecode formatif(t % 5 == 0) {
s = a;
}
if(t % 5 == 1) {
s = b;
}
if(t % 5 == 2) {
s = c;
}
if(t % 5 == 3) {
s = d;
}
if(t % 5 == 4) {
s = c;
}timeToTimecode(g = s + thisComp.displayStartTime, timecodeBase = 23.976, isDuration = false); //converts s into timecode format
[g]; //states the value (in timecode format) of the original footage frame valueif(t % 5 == 4) {
a++; b++; c++; d++; //adds 1 to each variable once for every 5 frames
}AE doesn’t take issue with any of the syntax, but it’s still not working. Where have I messed up?
Thanks in advance for any insight or reworking anyone can offer!