Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Time Remap Loop using an Expression Control

  • Time Remap Loop using an Expression Control

    Posted by Robert Kornstein on March 5, 2014 at 2:02 am

    I am trying to set up a puppet for a character with a pseudo-3D effect. I have 8 images of the character at different angles, which, when viewed in sequence, form a 360 degree rotation around the character.

    I set up the 8 images in sequence in a pre-comp, and now I am trying to create a controller for the rotation using Time Remapping.

    How can I code an expression for Time Remapping to have it continue looping as the controller’s value goes up?

    Here’s what I have right now:

    This code is mostly non-functional. The top line makes it so that 1.00 on the slider = 1st frame of the pre-comp, and that’s about it. I don’t know how to make the If statement recursive so that it’s constantly checking to see if offset is less than 8 (right now it only loops once and then continues growing), and going less than 0 on the Slider does not rotate backwards, I’m guessing because you can’t have a negative Time Remapping.

    Does anyone have any tips that might point me in the right direction?

    offset = thisComp.layer("LI_rotation").effect("Torso Rotation")("Slider")/24;
    if (offset > 8){
    offset - 8
    }
    else if (-8 <= offset <= 8 ) {
    offset
    }
    else if (offset < -8) {
    offset + 8
    }

    Dan Ebberts replied 12 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    March 5, 2014 at 4:27 am

    If you use the modulus operator (%) you can create a sequence from 0 to 7 that repeats as the offset goes up, like this:

    offset%8

    If that corresponds to a frame number, then you probably need to do it this way for a time remapping expression:

    framesToTime(offset%8)

    Something like that.

    Dan

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