Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Interpolating animation

  • Interpolating animation

    Posted by Nick Kennedy on July 8, 2019 at 11:46 am

    Is it possible to interpolate between three values using ease() or linear() expressions. Or what expression could I use to move an object between three values? I can’t use keyframes alone because the third position is always determined by the width of a name(I’m trying to build a lower third, see image, the right hand white bracket).

    The first position of the right hand white bracket is off screen and the second position is meeting the lefthand white bracket, these are set positions.
    Only the third position is variable depending on the size of the name. It will eventually become a mogrt file for premiere pro editors to use only chenging the name etc,
    Any ideas anyone? I’d much appreciate some help.
    As I’ve done before here on creative cow If i get this solved I’ll send my project to whoever wants to see it

    Nick Kennedy replied 6 years, 10 months ago 4 Members · 6 Replies
  • 6 Replies
  • Tomas Bumbulevičius

    July 8, 2019 at 7:26 pm

    Hey Nick, could you upload actually animated lower third video, if it moves in any way?

    In addition:
    1. How you set left/right paddings for text box? They are not equal, so wonder if it grows only from certain size.
    2. How currently brackets positions are set to be in the bottom/top corners?
    3. Do you use any parenting here?

    Find out more:
    After Effects Tutorials: motion design, expressions, scripting.
    Boxer – Dynamic Text Boxes Template with a Live Preview

  • Filip Vandueren

    July 9, 2019 at 2:39 pm

    Maybe you can be clever and use position keyframes/expression for 1 part of the animation,
    and anchorpoint keyframes for the other ?
    It depends on your animation if that’s a feasible route, but it’s always a neat trick to remember that they work well in conjunction.

  • Andrei Popa

    July 10, 2019 at 10:32 am

    I think this may be what you need

    if (time>key(2).time){
    x = linear(position[0], key(2).value[0], key(3).value[0],key(2).value[0], thisComp.layer("Control Null")("Transform")("Position")[0]);
    y = linear(position[1], key(2).value[1], key(3).value[1],key(2).value[1], thisComp.layer("Control Null")("Transform")("Position")[1]);
    [x,y]
    }else{
    value
    }

    This works as long as you do not need to modify anything after the 3rd keyframe.
    You can also calculate the third position, instead of linking it to a layer.
    This also allows you to interpolate the animation as you want(it takes the easing from the keyframes, it just modifies the values).

    Andrei
    My Envato portfolio.

  • Nick Kennedy

    July 11, 2019 at 11:41 am

    Hallo Andrei

    this is getting very close to what I want, thanks a lot for you help. The x position is always correct no matter how long a name I type in.
    There is, however, still a problem with the y position, it lands kind of halfway down and after the 2nd keyframe the y position jumps too. See the photos

    These first two show that when the name changes the x position is correct. The y position is not?

    Here is the expression

    This picture shows the first frame after the 2nd Keyframe. The y position jumps up and then moves to the end position. in the middle of the Lower third. I’ve now tried a few things but cant get the y position correct. Any ideas here what might be going wrong? Thanks for your help so far, cheers, nick

  • Andrei Popa

    July 11, 2019 at 12:02 pm

    Depends if your y grows or dimishes. Did not think that through. If your y is smaller at the 3rd key, you should change the last 2 values of the linear function like this:

    if (time>key(2).time){
    x = linear(position[0], key(2).value[0], key(3).value[0], key(2).value[0], thisComp.layer("Control Null")("Transform")("Position")[0]);
    y = linear(position[1], key(2).value[1], key(3).value[1], thisComp.layer("Control Null")("Transform")("Position")[1], key(2).value[1]);
    [x,y]
    }else{
    value
    }

    Andrei
    My Envato portfolio.

  • Nick Kennedy

    July 11, 2019 at 12:18 pm

    SOLVED !!!

    Wow Andrei, many many thanks for your help. Everything working fine.
    Cheers, Nick

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