ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Control scale keyframes with slider

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ryan Hagen
Control scale keyframes with slider
on Dec 5, 2017 at 6:28:59 pm

This is the expression i'm using, and it's not working currently. I have 4 keyframes total, and i'm unsure if I needed to add that in the expression as well(unsure how or where).
To further clarify, I have a box, animated on it's X, it animates on, holds for a certain period of time, and then animates back to zero. I want to give the end user the ability to change the box's scale with the slider. So if the scale is 100, if they set it to 20 on the slider, it would be 120, without having to adjust the keyframes. I hope that makes sense. Thanks for any help.

if (numKeys > 1){
t1 = key(1).time;
t2 = key(2).time;
v1 = 0;
v2 = value + thisComp.layer("Info_box_ct").effect("infoBox_length")("Slider")

Return to posts index

Andrei Popa
Re: Control scale keyframes with slider
on Dec 6, 2017 at 9:05:39 am

The way i understand it is . You have a box, animate its x scale 0->100, hold at 100, then 100->0 and would like your 100 to be controllable. In this case i think this would work.x=value[0]*effect("Slider Control")("Slider")/100;
You must adjust the "effect("Slider Control")("Slider")" to your slider by pickwhiping to it.

My Envato portfolio.

Return to posts index

Ryan Hagen
Re: Control scale keyframes with slider
on Dec 6, 2017 at 2:11:37 pm

Thank you Andrei, that worked well enough, I just need to make sure the slider is set to 100 and it works like a charm. Thank you for your help!!!

Return to posts index

Wisnu Wibowo
Re: Control scale keyframes with slider
on Dec 25, 2017 at 4:21:41 pm

I have 2 keyframes, I want to change the scale with the slider control at 2nd keyframe and add inertial bounce expression.
I tried this expression but the inertial bounce doesn't work, inertial bounce will work if I put "temp = value[0]*effect("Slider Control")("Slider")/100; [temp, temp]" on the top but the slider controller doesn't work.
Please help me.

n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
if (n == 0){
t = 0;
t = time - key(n).time;

if (n > 0 && t &lt; 1){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = .05;
freq = 4.0;
decay = 8.0;
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

temp = value[0]*effect("Slider Control")("Slider")/100;
[temp, temp]

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 All Rights Reserved