Hey everyone, this is Owen with Motion Array and in this tutorial I’ll be showing you how to keyframe the wiggle expression in After Effects. In this example I’ll be using it to generate a random animation for a bar graph. So that the bars only grow in the Y dimension, we’ll also be isolating the wiggle to only affect the Y scale. Alright, let’s get started.
I’ll begin in this other composition that already has the bones of the design in it. There’s a line and three rectangles to make the bar graph. An important thing to note is that the anchor points on the rectangles is down at the bottom of the layer so that I can change the Y scale and it will stay grounded to the line.
Now make a new null object, Layer > New > Null Object, and call it “Wiggle Control”. With the null selected go to Effect > Expression Controls > Slider Control. Rename the slider control to “Amplitude”. Pull up the scale of Bar 1 and Option + click on the Stopwatch and add this expression:
a=thisComp.layer(“Wiggle Control”).effect(“Amplitude”)(“Slider”);
w=wiggle(2,a);
[value[0],w[1]]
Copy and paste this expression into the scale of the other two bars. Now we can keyframe the Amplitude slider to create an animation. At frame 20 set a keyframe on the Amplitude slider with a value of 0. At frame 50 change the value to 50 and then at frame 80 set another keyframe for 50. At frame 110 change the Amplitude back down to 0 and then easy ease all the keyframes.
To make this look a little nicer I’m going to bring in some patterns to be the “fills” of the bar graph. I’ll bring in all 3 patterns (including in project file) and put each below one of the bars. Then change the track matte on all the pattern layers to Alpha Matte. With one of the pattern layers selected go to Layer > Layer Styles > Stroke. In the stroke settings change the color to black, the size to 15, and the position to center (to match the horizontal line). Under the layer select the word “Stroke” and copy it and then paste it onto the other two pattern layers.
Well, that concludes this tutorial. I hope you found it helpful, if you did, please give us a thumbs up and if you’d like to see more tutorials please go ahead and subscribe because we’re making new ones all the time. We’ve got lots of other Premiere Pro tutorials, After Effects tutorials and filmmaking tutorials!