ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Control two (X-)position keyframes while keeping the (temporal) interpolation

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Gustavo Rafaelo
Control two (X-)position keyframes while keeping the (temporal) interpolation
on May 10, 2018 at 3:10:50 pm

Hi, I'm a little bit new to expressions. After hours of googling trying and coding I gave up and try to get some help here.

I just want to keep my simple animation with the temporal interpolation. I only want to change with two sliders two keyframes. Is that somehow possible?? I found much codes for scale, opacity, and also some for position but none of these work for me ☹



Thank you very much!!!

Here are some of my tries:

t4 = key(4);


slider = comp("Comp 1").layer("txtlayer").effect("Keyframe Slider 1")("Slider");
slider2 = comp("Comp 1").layer("txtlayer").effect("Keyframe Slider 2")("Slider");
t1 = [slider];
t2 = 960 = t3;
t4 = [slieder2];

}


// other expression now


if (numKeys > 1){
t1 = key(1).time;
t2 = key(2).time;
t3 = key(3);
t4 = key(4);

slider = comp("Comp 1").layer("txtlayer").effect("Keyframe Slider 1")("Slider");
linear(time,slider,t2,t3,t4);
}else

valueAtTime(t);


Return to posts index

Steve Bentley
Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
on May 10, 2018 at 6:12:39 pm

I'm not clear on what you are after but this might help. I take it you want to keep the keyframes where they are but change the values. You can just double click on each of the keyframes you want to change and enter new values. They won't move in time or change their ease type.



Return to posts index

Gustavo Rafaelo
Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
on May 10, 2018 at 7:06:40 pm

Unfortunately I need to change the value of the keyframes through a slider. Because I want to create a Essential Graphics template for Premiere Pro and yess, I've just didn't mentioned that because I don't want to confuse anybody, I just splitted the problem up in a small problem 😃


Return to posts index


Steve Bentley
Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
on May 10, 2018 at 7:16:38 pm

So are you needing something like: if (time ==X) { use slider value} else {use the value of the keyframes}



Return to posts index

Gustavo Rafaelo
Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
on May 10, 2018 at 8:30:10 pm

yes this might work, but the temporal interpolation would be really ugly, so it would create an unsatisfying result :/

it would end up in an ''animation jump'', that's what I call it


Return to posts index

Steve Bentley
Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
on May 10, 2018 at 8:42:57 pm

So then tie the position attribute to the slider and key frame the slider putting the keyframes you need on the slider only with the same values and at the same time as they were for position. Then you can use the slider anywhere else (but it will deposit a keyframe when you do)



Return to posts index


Gustavo Rafaelo
Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
on May 10, 2018 at 10:49:49 pm

That also doesn't works because of the motion graphics template.
I only want to be able as I told to control two keyframes with the slider.. other ways like keyframing the slider won't work :/ That's why I'm asking here, how to be able to control these 2 keyframes with a slider..


Return to posts index

Steve Bentley
Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
on May 11, 2018 at 2:39:33 am

Here are two ways.
If you can give the position value a formula and have the sliders produce values to use within that formula.
So lets say the position is a sin wave type shape. You could set the position with a formula of x=sin(time)... this is oversimplified but I"m hoping this might help. Then you bring in your slider and you change the formula to x=sin(time)+sliderValue. This way the base motion is there and you are just modifying the whole thing with a slider "offset".

or with keyframes already on your position attribute:

xVal=value[0]+effect("Slider Control")("Slider");
[xVal,540];
this way you can have your keyframes x value amplitude be controlled by the slider but keep your initial keyframes value. And you can keyframe your slider to have that change factor change over time. (the 540 number is just a dummy number for the y value so it stays the same.
value[0] is the first component of the position (the x) of the keyframes already defined in your timeline
[xVal,yVal] is how your write the position value when you want to break them apart.



Return to posts index

Gustavo Rafaelo
Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
on May 14, 2018 at 3:16:39 pm

THANK YOU!!


Return to posts index


Marcin Fischer
Re: Control two (X-)position keyframes while keeping the (temporal) interpolation
on May 17, 2018 at 12:01:59 am

Hi, I read this thread with great interest since I have a similar problem.
Unfortunately my problem was not solved here.

What if I want to control the position of JUST ONE of the keyframes by the slider?
The method you provide allows to offset the whole movement (in all or chosen dimensions).
I would like to offset just a certain keyframe. Is that possible with expressions?

In other words:
I want an object to move from position A [X1, Y1] to position B [X2, Y2].
Both points are keyframed.
Than I would like a slider to control the offset of the position B.
So my object moves from position A [X1, Y1] to modified position B [X2 + OffsetX, Y2 + OffsetY].

Is it possible to address SPECIFIC keyframe by expression, so it acts as if it was in different position (while obviously maintaining smooth transition between keyframes)?


Return to posts index

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