After Effects – Expressions

I must admit, following the pattern of previous weeks, I was expecting to walk in today and be looking at planar tracking. I’m now a little disappointed as this isn’t the case, today we’d be focusing on expressions in AE. However we have been given access to some training materials related to planar tracking as extra reading over Xmas.

Expressions are something I’d never heard of before, they’re essentially scripts/code within AE that alter properties. Not that I’m a self proclaimed coder, its probably my weakest area but I was still interested to go find out what language this was. Much like other Adobe products its syntax is based on Javascript.

While writing these myself goes straight over my head, they seem easy enough to apply if given a pre-written code snippet. I was not expecting the AE timeline to suddenly become an open text field for scripting. Alt left click on one of the keyframe clocks and voila, straight into editing for expressions.

I’ll dial back a little bit to the start of the exercise.

We setup a new composition at 720p, 25fps  and 200 frames long. Into this composition we imported two assets, a pink background and a blue circle. Certainly not as a complex as last week! After dragging in the background, a radial blur with a soft light blend mode was placed on the layer and set to 150% scale. All stuff we’ve seen before, however the next instruction was to Alt-click on the keyframe clock which opened up the box for expressions. In this box we added: wiggle(8,30).

Wiggle is what it says on the tin, the effect wiggles. However the numbers are the meat and potatoes here. The first number determines the amount of wiggles per second and the second number determines the variation in size. The 30 above is 30%, therefore the size variation can drop 30% of the value of 150 or increase by 30%. I would post a gif of this, however my darling wife already discovered our gif encoder will not render out the gradient properly. So here is a vimeo (moments like these really make me consider dropping the £7.99 a month on wordpress so I can post videos directly).

For the next step, the blue circle was added to the timeline along with a Null to parent it to. Within the ball layers transform options we pasted a chunk of code into position and a chunk into scale.

Position on the left, scale on the right. Before I reveal what the result of this looks like, just remember that I spent nearly a year hand animating on a light box doing stuff like this at labour intensive length. Damn you programmers!!

A rather impressive and pretty accurate boucning ball, the code even got the peaks of the arcs correct. The velocity and gravity can be changed on the fly, editing the numbers in the scripts. Just as long as you change it in both, I had some strange results only making the edits in one. The whole thing is very impressive but much the same as C# or any other language, its not my strong suit. I’ll likely end up using scripts I find off the internet if I need to use an expression.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s