Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to control a layer in-point and out-point animation with time remapping slider

  • How to control a layer in-point and out-point animation with time remapping slider

    Posted by Sebastien Bruzzo on August 18, 2017 at 10:13 am

    Hello everyone !

    Here’s my situation :

    I have a precomposed animation for a layer (incoming and outgoing are different animations) and i’d like to use time-remapping to set the incoming animation on the layer in-point and the outgoing animation on the layer out-point.

    For example, here’s what I’d like to do :
    – at the layer in-point, a 35 frames animation starts
    – 10 frames before the layer out-point, the outgoing animation starts

    I’ve seen many expressions about time-remapping with a slider, but no one really matches my needs.

    Thank you all for your help.

    Roy Huetink replied 8 years, 8 months ago 2 Members · 4 Replies
  • 4 Replies
  • Sebastien Bruzzo

    August 19, 2017 at 1:28 pm

    I’ve find this nice expression from Kevin Camp, but it’s designed to read the animation forward and backward.

    t = thisComp.frameDuration*15;
    if (time-inPoint <= t) time-inPoint;
    else if (time >= outPoint-t) outPoint-time;
    else t;

    In my case I’d like almost the same, except the layer’s outpoint (minus the duration of the outgoing animation) plays forward.
    Not sure I make myself clear :))

  • Sebastien Bruzzo

    August 19, 2017 at 4:53 pm

    And I’ve found a few minutes ago this expression that almost perfectly does what I want :

    //On the time remap property
    L = thisLayer;
    t = time;
    animLength = 10;
    animLength *= thisComp.frameDuration;
    LDur = L.outPoint-L.inPoint;
    MidDur = LDur - animLength*2;
    if( t>=L.inPoint && t<= L.inPoint+animLength) {t-L.inPoint}
    else if( t>L.inPoint+animLength && t<L.outPoint-animLength) {animLength + (t-L.inPoint+animLength)/MidDur)*(L.source.duration-animLength*2)}
    else if(t>=L.outPoint-animLength && t<=L.outPoint) {t-(L.outPoint-animLength)}
    else 0;

    It plays the first 10 frames of the animation at the layer’s inpoint, then stretches the in-between frames, and plays the last part of the animation 10 frames before the layer’s outpoint.

    I can use this expression, but I would like to know if it could be improved in order to freeze the animation in the middle.

    Thanks !

  • Roy Huetink

    September 5, 2017 at 7:47 am

    Hi Sebastien,

    I am getting an error on line 9 if I try this expression (Expected: ;.). Do you know what is going wrong?

    Thanks,
    Roy

  • Roy Huetink

    September 5, 2017 at 10:30 am

    I’ve found another expression which works for me:

    L = thisLayer;
    Src = L.source;
    SrcDur = Src.duration;
    LDur = L.outPoint-L.inPoint;
    SrcInDur = framesToTime(28); //the duration of the in animation
    SrcOutDur = framesToTime(34); //the duration of the out animation
    SrcLoopDur = SrcDur-SrcInDur-SrcOutDur;

    if(time &lt; L.inPoint+ SrcInDur) {
    tSampleT = time-L.inPoint;
    } else if(time > L.outPoint-SrcOutDur) {
    LOutElapsed = time - (L.outPoint-SrcOutDur);
    tSampleT = SrcDur-SrcOutDur + LOutElapsed;
    } else {
    tSampleT = SrcInDur+Src.frameDuration;
    }

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