Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Time Remapping: Loop with Ping-Pong but also progress forward

  • Time Remapping: Loop with Ping-Pong but also progress forward

    Posted by David Potvin on February 28, 2013 at 4:06 am

    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 > 2

    5 > 1
    6 > 2
    7 > 3
    8 > 4
    9 > 3

    10 > 2
    11 > 3
    12 > 4
    13 > 5
    14 > 4

    I’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 format

    if(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 value

    if(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!

    Vishesh Arora replied 13 years, 6 months ago 2 Members · 3 Replies
  • 3 Replies

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy