ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Saso Goricar
Expression
on Feb 26, 2020 at 7:57:24 pm

Hello,

I've created an animation of the stroke width from 0 to 10px with keyframes. Is there a way to create an expression, that I can change the width of the second keyframe with a controller?

Thanks, Saso


Return to posts index

Marticus Kilverticus
Re: Expression
on Feb 28, 2020 at 3:19:54 pm
Last Edited By Marticus Kilverticus on Feb 28, 2020 at 3:20:53 pm

So long as youre only going between 2 keyframes, make a new slider somwhere with your width on it, then apply this to the strokes width:

width = (pickwhip to a new number slider);
linear(0,10,0,width)

That just replaces 10 with your new sliders value.


Return to posts index

Alex Printz
Re: Expression
on Feb 28, 2020 at 3:22:23 pm

I've posted code below; just make sure your 2nd key's value is different than the first key's value (0px vs 10px).

linear(value, key(1).value, key(2).value, key(1).value, effect("Slider Value")(1))

Alex Printz
Mograph Designer


Return to posts index


Saso Goricar
Re: Expression
on Feb 28, 2020 at 6:32:08 pm

Yes, you are both right, I used this linear expression
var y = comp("MOGRT").layer("MOGRT Controls").effect("Slider Control")("Slider")
linear(y,0,20,0,20);

I allowed max 20px of width.

Thanks both for the idea for using this expression, I didn't know that I could use it this way.


Return to posts index

Saso Goricar
Re: Expression
on Feb 28, 2020 at 6:36:12 pm

No, It's not working. The expression disable keyframes. I can control the width, but the width doesn't animate from 0 to 20


Return to posts index

Alex Printz
Re: Expression
on Feb 28, 2020 at 8:49:15 pm

Use my expression above. The expression posted by the other user isn't pulling anything from keyframes.

Alex Printz
Mograph Designer


Return to posts index


Saso Goricar
Re: Expression
on Feb 28, 2020 at 9:15:22 pm

Now I got it, it works perfectly. Thanks for the help with my problem, it works. Thanks again.


Return to posts index

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