ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Link Single Scale Keyframes to Sliders and keep others unchanged.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Will Bartlett
Link Single Scale Keyframes to Sliders and keep others unchanged.
on May 12, 2020 at 8:58:23 am
Last Edited By Will Bartlett on May 12, 2020 at 9:06:08 am

Hi there,

I have a simple animation that has 4 keyframes on the Transform effect's Scale parameter of an adjustment layer to control footage below it.

I would like the first keyframe to remain at 100% scale, the second keyframe to be linked to Slider1 that will allow for a scale adjustment, the 3rd keyframe to be linked to Slider2 that will allow for a scale adjustment, and the 4th keyframe to remain at 100% scale.

I've found the following expression from Dan Ebberts (Who seems to provide a lot of help on this forum, so thank you for all of the help!), but the expressions is for only 2 keyframes, and 1 slider:
if (numKeys > 1){
t1 = key(1).time;
t2 = key(2).time;
v1 = 0;
v2 = effect("Slider1")("Slider");
linear(time,t1,t2,v1,v2);
}else
value


How can I change this to make it work for my scenario? I tried the following, but couldn't get it to work:

if (numKeys > 1){
t1 = key(1).time;
t2 = key(2).time;
t3 = key(3).time;
t4 = key(4).time;
v1 = 100;
v2 = effect("Slider1")("Slider");
v3 = effect("Slider2")("Slider");
v4 = 100;
linear(time,t1,t2,t3,t4,v1,v2,v3,v4);
}else
value


I'm getting the following error:


Thanks so much for any help!!


Return to posts index

Dan Ebberts
Re: Link Single Scale Keyframes to Sliders and keep others unchanged.
on May 12, 2020 at 3:57:07 pm

Try it this way:


if (numKeys > 1){
t1 = key(1).time;
t2 = key(2).time;
t3 = key(3).time;
t4 = key(4).time;
v1 = 100;
v2 = effect("Slider1")("Slider");
v3 = effect("Slider2")("Slider");
v4 = 100;
if (time < t2)
linear(time,t1,t2,v1,v2)
else if (time < t3)
linear(time,t2,t3,v2,v3)
else
linear(time,t3,t4,v3,v4);
}else
value



Dan



Return to posts index

Will Bartlett
Re: Link Single Scale Keyframes to Sliders and keep others unchanged.
on May 12, 2020 at 6:39:06 pm
Last Edited By Will Bartlett on May 12, 2020 at 6:54:34 pm

That works, thank you!! The only issue now is I have CC Force Motion Blur on the adjustment layer as well, and now that the sliders are connected, it has changed the gradual motion blur showing up on the footage below the adjustment layer.

Originally without the sliders, the motion blur would start from keyframe 1 and gradually become more until the 2nd keyframe (Since the scale was increasing from 100% to 250% for example). And then from keyframe 3 to 4, the motion blur would gradually be less (Since the scale was going from 50% to 100% for example).

Is there a way to keep the motion blur looking the same as it was before the sliders, while the sliders are active?

I appreciate your help - Anyway I can return the help? Channel to sub to? Accounts to follow?

Best,


Return to posts index

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