After Effects Expressions

Expressions are small bits of code that you type into After Effects, to change somethings or animate a shape in a certain way. It is a little bit of software that says that a property is something or gets the property of a layer to do something you want. The two expressions that we learned are the wiggle expressions and loop expression.

 

Loop Expression 

Create a new composition, new solid and a circle. Using position, transform the circle to move across the screen and back. The goal is to make the animation repeat without using copy and paste.

 

 

Press alt and click on the stopwatch next to position to apply an expression. A box will appear under the keyframes, in which you type in loop and select ‘loopOut()’. In the brackets, put ” and some options will appear, of which ‘cycle’ should be selected. Then, no matter if the timeline passes the keyframes, the animation will repeat thanks to the loop! Things like easy ease and motion blur can be added for some more personality.

 

 

Wiggle Expression

The wiggle expression isn’t too different a process to add then the loop. Again, have a circle or any other shape ready, and ideally, centre it and its anchor point. Animating the circle is optional, as this expression works on its own. Hold alt and click the stopwatch next to position, type in wiggle and select ‘wiggle()’. This expression consists of two different values in the brackets: the first being the frequency, so how often you want the shape to move per second, and the second is amplitude, which is how erratically it moves, or how much it is allowed to change above/below the starting points. These parameters can be experimented with, so we started with wiggle(10,50) and played around from there. I enjoyed steadily increasing the values, reaching into the hundreds and seeing how crazy the circle looked, like an atom with a lot of energy in its kinetic store, and dipping right down, with numbers under ten, to see what movements I could make with a greater difference between frequency and amplitude.

These expressions are very versatile and can be used to make animation a lot faster and easier in some cases. To progress a little more with expressions, we decided to apply them and see an example that can actually be used in animation. In adobe illustrator, I imported a simple spider silhouette and using the pen tool, traced over the outline to create an asset and import it into After Effects. I obviously could have gone with something more detailed, but I consider this as simply practise, for getting used to using expressions.

 

 

After making a simple animation of the spider moving across the screen, I used the puppet tool to make the legs move and make it look like the spider is crawling. I think that I could have been more precise with the leg movements, and looked at some videos to see how spiders crawl, but I sort of did my own thing, and made the legs move randomly, to save time and add some more to the animation.

 

 

I then added the wiggle expression to the spider, to make it wiggle slightly as it moved. I thought that it could have been more realistic, so I added another bug to try again, and I think it is mainly down to the movement of the legs paired with the transform animation of the shape. When making the bugs move, I also added rotation, so that they don’t look like they’re just floating, but actually turning and scuttling about. I think these rotations were too smooth, and a little separate from the legs moving, which made the bugs seem more robotic. I think the wiggle expression helped with this, and I am still pleased with the result.

 

 

I was starting to get more comfortable with applying expressions, so I wanted to try using the wiggle exp. on fire. I found a beautiful piece of art, of a nightmare with flames coming off its body, and decided to try on that. Again, I had to use the puppet tool so that I would only be animating the flames but despite that, I still ended up deforming some of the horse’s body as well. It wasn’t too distracting though, so I knew that it could be played off as part of the effect and I didn’t try to change too much. Then, I tried to apply the wiggle expression and found that it actually made very little difference. I think it would have worked much better with a flickering fire, like a bonfire, but with flames like these, wiggling would look a little strange. I used the wrong image for the fire then, but I still like the few seconds I created and decided to keep it.

 

 

Later on, in our second lesson, we used expressions again for some more cool animations. For the first one, we were asked to make a spinning coin, as it would be a good recap on 3d layers, and also a challenge to see if we could figure it out by ourselves. I struggled with this because after turning all of the layers 3d, I was too focused on the three-axis of the coin in 1 view, and was only changing the position. I should have gone straight to rotation. I even went to watch a youtube video for a hint, and it was overly complicated, but inspiring, and I decided to try it out at a later time. The actual answer was very simple and I felt silly not knowing it – just the y-axis rotation. I hadn’t even gone to the layers panel because I was so focused on the coin and its x,y and z-axis in the active camera. After a little help and I figured out this simple solution, I quickly animated one turn of the coin and added the loop expression. It did look thin because it was a 2d image of a coin, but I sort of knew how to make it thicker from the video, so I will try the spinning coin animation again in the future! I can already imagine it with some lighting and shadows, perhaps even some easy ease to spice up the motion.

 

 

After that, we jumped into a quick tutorial for making a moth’s wings flutter. I drew a moths body and one wing in Illustrator with simple shapes and imported them separately so that I could animate the wings. At first, I didn’t make the wings go all the way back and forward, but at an angle, and it was pointed out to me that this wasn’t quite the erratic movement we were going for, so I watched a second explanation of how to move the wings in the 3d perspective, much more carefully, and I understood. It wasn’t a matter of copying the keyframes for one wing to another either, otherwise, they wouldn’t work like a mirror, but rather a seesaw, which wouldn’t look like fluttering. Similarly to the coin, the y-rotation was used to move the wings back and forth, so I had my view set up from two angles so that I could see how far I was rotating them.

 

 

I finally finished animating the wings, so I bought the keyframes extremely close together, to make the flutter faster, and added a loop. I precomposed all of the layers and my moth was ready. I pulled the image of the lamp we were asked to use and shrank my moth so that it looked realistic, flitting around the light. To finish it off, I animated it moving around in a few random directions and voila, a nice silhouette of a flying moth. I think that this process wasn’t as complicated as I made it seem. I believe that I was overthinking things and in hindsight, I enjoyed the process and would repeat it again, now that I know it isn’t awfully complicated to create the illusion of this type of flight.

 

 

As an extension, if we completed this task, we could try creating a different moth and using lighting. This would require some more detail and colour, as the moth would be in the spotlight, and wouldn’t be a silhouette (so entirely black). I quite like lunar moths, so I chose an image of one to use in Illustrator as my template. I didn’t add in all of the details, and I kept it relatively simple with the colours and pattern, but it was still quite pretty. Next, I imported the asset into After Effects, and repeated the process of animating the wings exactly like the last one, and much quicker this time, because I was confident and knew what I was doing. The best part by far was after I precomposed the moth and added it into a separate composition with the light layer. It felt really gratifying having one complete animation and placing it within another. If I had more time I would have liked to play around with the settings of the spotlight, but for now, just seeing my moth flying around with a shadow and fluttering in a realistic way, was more than good enough – I feel like this is a successful little animation and I really like my choice for doing a lunar moth!

 

Leave a Reply

Your email address will not be published. Required fields are marked *