- February 26, 2020 at 7:57 pm
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?
- February 28, 2020 at 3:19 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);
That just replaces 10 with your new sliders value.
- February 28, 2020 at 3:22 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))
- February 28, 2020 at 6:32 pm
Yes, you are both right, I used this linear expression
var y = comp("MOGRT").layer("MOGRT Controls").effect("Slider Control")("Slider")
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.
- February 28, 2020 at 6:36 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
- February 28, 2020 at 8:49 pm
Use my expression above. The expression posted by the other user isn’t pulling anything from keyframes.
- February 28, 2020 at 9:15 pm
Now I got it, it works perfectly. Thanks for the help with my problem, it works. Thanks again.
Log in to reply.