FORUMS: list search recent posts

how to connect only 1 of multiple keyframes to a slider control?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Emmett Fraser
how to connect only 1 of multiple keyframes to a slider control?
on Oct 24, 2016 at 1:01:36 am

I apologize in advance if this is a dumb question. My experience so far is limited to pick whipping values to slider controls. Really basic stuff. But I've run into a problem where I want something to animate from 0 to x (as determined by the slider) and pick-whipping just ain't gonna cut it anymore.

How would I write the expression to make the first keyframe consistent, and the next keyframe link to the slider?

To give a specific example, I have a path with a stroke. I know that I want the stroke width to begin at 2 and end at 2, but I would like the value in the middle to be controlled by a slider. ie. key1 = 2, key2 = x, key3 = 2.

Thanks in advance! Any help would be greatly appreciated!


Return to posts index

Jorge Froberg
Re: how to connect only 1 of multiple keyframes to a slider control?
on Oct 24, 2016 at 9:31:34 am

This should work. Put this expression on the Stroke Width value.
What it does is it will tell AE to only use the slider value between 2 and 3 seconds. Outside of that range it will use your normal keyframes.
Hope it helps.

if (time >= 1 && time &lt;= 3) {
effect("Slider Control")("Slider");
} else {
content("Rectangle 1").content("Stroke 1").strokeWidth;
}


Return to posts index

Emmett Fraser
Re: how to connect only 1 of multiple keyframes to a slider control?
on Oct 24, 2016 at 5:41:09 pm

Thanks Jorge, I'll give this a try!


Return to posts index


Emmett Fraser
Re: how to connect only 1 of multiple keyframes to a slider control?
on Oct 25, 2016 at 9:47:41 pm

Hey Jorge, just wanted to let you know where I ended up. Your snippet was really helpful to get me started and send me down the right path. Once I got yours working I wanted to change it so that the timing of the change could be controlled by a marker on the layer.

After a lot of trial and error I ended up with this!

I pasted the code in the Stroke Width property and made a slider called "spark width".

Anyways, thanks for your help!

time_to_marker = Math.abs(time - thisLayer.marker.nearestKey(time).time)*5
easeOut(time_to_marker,comp("_controller").layer("Controller").effect("spark width")("Slider"),2)


Return to posts index

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