ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Interpolating animation

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nick Kennedy
Interpolating animation
on Jul 8, 2019 at 11:46:38 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


Return to posts index

Tomas Bumbulevičius
Re: Interpolating animation
on Jul 8, 2019 at 7:26:40 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


Return to posts index

Filip Vandueren
Re: Interpolating animation
on Jul 9, 2019 at 2:39:19 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.



Return to posts index


Andrei Popa
Re: Interpolating animation
on Jul 10, 2019 at 10:32:37 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.


Return to posts index

Nick Kennedy
Re: Interpolating animation
on Jul 11, 2019 at 11:41:49 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


Return to posts index

Andrei Popa
Re: Interpolating animation
on Jul 11, 2019 at 12:02:27 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.


Return to posts index


Nick Kennedy
Re: Interpolating animation
on Jul 11, 2019 at 12:18:47 pm

SOLVED !!!

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]