prev next
by mamoworldmamoworld icon

Section 2

Elastic iExpression

Creating a deformation usually requires a lot of tedious keyframing work. I hate tedious work – in fact, if you look at the After Effects extensions that I’ve developed, you’ll notice their main goal is usually to simplify or automate your work wherever possible. Creating a Squash & Stretch animation is usually a two-step process: first you transform (move, rotate, scale) the layer, then you add effects to deform it. When creating the deformation, you analyze the movement and then come up with a deformation that fits it. Wouldn’t it be great if this second step could be automated?

I’ve already explained that Squash & Stretch isn’t a simple process, so it’s no surprise that there’s no fully automatic method to extrapolate the deformation from the movement of a layer. This is definitely the case for Active Squash & Stretch – there’s just no way to predict the actions of a self-determined, living creature. But we’ve also seen that Passive Squash & Stretch follows fairly predictable laws of physics, and is mostly driven by inertia. So wouldn’t it be great if we could run a simple physics simulation in After Effects to analyze the movement of a layer then calculate how it should deform, based on inertia? Well, that’s exactly what I did with the Elastic iExpression.

What is iExpressions?

Expressions are little JavaScript programs that can replace the keyframes of any property in After Effects. So if you want to animate a property, you can either specify how it should change over time with keyframes, or you can write a little program that calculates the desired property value for each point in time. This is a very powerful feature of After Effects, and a great tool for any kind of automation. If you’re a programmer and you have enough time, you can create all the tools you can dream of. But if you’re a cook, you need vegetables, not a greenhouse that allows you to grow any vegetables you want. You might not have the time or the skills to do that – it’s not your job to create the vegetables, you just want to use them.

Movie 10.5 iExpressions V3

This is why I created iExpressions. It’s a collection of more than 100 expressions, all with an easy to use interface. There’s no need to read or write any code to use them. iExpressions covers a large variety of topics, from expressions to create animated random text blocks to bouncing ball simulations, and from an expression that can add an arrowhead to a line, to automatic walk cycles. It also contains the Elastic iExpression, which is my approach to automatically creating passive Squash & Stretch.

Elastic iExpression

The Elastic iExpression is an expression that you apply to the path of a shape layer. Once you apply the expression to a path, it analyzes the movement of the shape layer and deforms the path based on inertia. Here’s a comparison of an animation without and with the expression.

Movie 10.6 Before and After Applying the Elastic iExpression

Since the expression only works on shape layers, I first converted the text to shapes (right click on the text layer->Create->Create Shapes from Text). I then animated the position and rotation (in this case with a Basic Wiggle expression, but you could also keyframe it) and finally applied the iExpression to all the shape layer’s paths.

This two minute tutorial shows the process in full; as a bonus, it also features an easy technique for creating speed lines.

Movie 10.7 Elastic Expression & Motion Trails

Elastic iExpression Details

If you want to work with the Elastic iExpression in the most effective way, it’s helpful to understand a little bit about how it works. For performance reasons, it doesn’t do a full-blown Finite Element Method simulation. Instead, it looks at all vertices of the shape and checks how far away they are from the anchor point of the layer. The anchor point is like the white box in our Overshooting Example. So, a shape vertex that’s at the anchor point doesn’t deform at all. All other vertices deform, and the further away they are from the anchor point, the more they deform. So the location of the layer’s anchor point is crucial to the final result.

Movie 10.8 Anchor Point for Elastic iExpression

The location of the anchor point (white dot) influences the deformation of the Elastic iExpression

Also keep in mind that the expression uses the vertices of your path. So, if you have a very simple shape (say a square), it might be useful to add some extra vertices to the straight edges. This will enforce the calculation of the deformation at those points too, and yield more accurate results.

Automation and Creativity

How much control do you have over a deformation if it’s auto-generated – doesn’t it limit your creativity? Aren’t you more flexible when you keyframe it? Perhaps the answer would be yes – if we ignored that fact that we’re human. Being creative is a lot like playing - it’s most effective if you can move quickly between ideas. It’s also much more fun if you can get good looking results fast. If you’ve just spent two hours keyframing something, you’ll hesitate to dismiss it. It’s a different story if you created it with just two clicks, however. Limitations can also be helpful. With the elastic expression, you certainly can’t create every kind of deformation that you’re able to keyframe by hand, but first and foremost it prevents you from making inconsistent deformations that look bad. And you still have a lot of control over the details – with the Delay parameter of the Elastic iExpression, you can control the overall amount of deformation, and also separately control the amount of overshoot and wobble.

The benefit of automatic deformation is not just that it saves you time - it also means you can respond to the feedback from your client or your boss much faster. If the feedback is ‘Looks cool, but can you make the deformation a bit less intense?’, the difference between redoing a ton of keyframes and just dialing down the Delay parameter of the iExpression is huge. With the expression, you can instantly show different variants, instead of asking your boss to come back in an hour. You should avoid automation that limits you, like preset systems that come with canned animations that can’t be modified at all. You should, however, use automation tools that allow you to explore and change things quickly. When we develop a tool, our goal is always to support your creative process, not limit it.

prev next
by mamoworldmamoworld icon