New Feature: Playlist Center! Pick a topic and let our playlists guide the way—like a learning mixtape.

Start learning with our library of video tutorials taught by experts. Get started

After Effects Apprentice 09: Expressions
Illustration by John Hersey
Watching:

The wiggle expression


From:

After Effects Apprentice 09: Expressions

with Chris Meyer and Trish Meyer

Video: The wiggle expression

Next, I'd like to show you our favorite expression of all, Wiggle. First I'll clean up my display by closing all of my previous comps and open up 05-wiggle*starter. In it I just have a little gizmo in the middle of my screen just doing his own little animation. Let's say I want this gizmo to wander around the screen. In other words, I want to wiggle its position. I'll type P to reveal the position value, hold down Option or Alt to enable expressions for Position, click, and in place of the default expression transform.position, I am going to type wiggle, open parentheses, and I need to enter two numbers, how fast I want to wiggle and how much I want to wiggle by.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
After Effects Apprentice 09: Expressions
1h 37m Intermediate Jul 27, 2011 Updated Nov 29, 2012

Viewers: in countries Watching now:

Expressions are one of the most powerful but underused features in After Effects. They can be used to animate layer properties with code, as compared to explicitly keyframing every value in the Timeline, and have multiple parameters and layers that follow the lead of a master layer or controller effect, making it much easier to coordinate complex animations and quickly accommodate client changes. In this introduction, Chris Meyer shows how to let After Effects do most of the work by creating simple but very useful expressions that can be put to work on a wide variety of jobs.

The After Effects Apprentice videos on lynda.com were created by Trish and Chris Meyer and are designed to be used on their own and as a companion to their book After Effects Apprentice. We are honored to host these tutorials in the lynda.com Online Training Library®.

Topics include:
  • Creating and managing expressions
  • Linking together different parameters
  • Randomizing a layer's movement
  • Looping an animation
  • Controlling multiple layers from a single source
Subjects:
Video Motion Graphics Visual Effects
Software:
After Effects
Authors:
Chris Meyer Trish Meyer

The wiggle expression

Next, I'd like to show you our favorite expression of all, Wiggle. First I'll clean up my display by closing all of my previous comps and open up 05-wiggle*starter. In it I just have a little gizmo in the middle of my screen just doing his own little animation. Let's say I want this gizmo to wander around the screen. In other words, I want to wiggle its position. I'll type P to reveal the position value, hold down Option or Alt to enable expressions for Position, click, and in place of the default expression transform.position, I am going to type wiggle, open parentheses, and I need to enter two numbers, how fast I want to wiggle and how much I want to wiggle by.

Let's say I only want to wiggle at a pace of one wiggle a second, fairly sedate, and let's say I want to wiggle by 100 pixels. Note that I separated the numbers with a comma. The space is not necessary; I put that in just to make it easier to read. And then close parentheses. Press Enter on numeric keypad, 0 to RAM Preview, and now my gizmo is indeed wandering around my screen. If I want him to wander faster, I increase the 'how fast' number from 1 to 2, RAM Preview.

Now he is much more kinetic and much crazier. If I don't want him wandering by quite as much, I enter a different number, like, say, 50 pixels, Enter, and preview. So now he sticks closer to the side of the screen, although he is wiggling very quickly. I'll go back to where we started, one wiggle a second and 100 pixels of wiggle. Notice that by default you don't see any motion path. We've not keyframed position. We just added wiggle on to the current position.

If you want to see that path, you need to enable the Post-Expression Graph button that we showed you in the previous movie. As soon as I turn that on, you will now see the motion path for the wiggle. As I drag the Current Time Indicator, you'll see him move along that wiggly path. Now you might run into occasions where that path is not long enough. We're not seeing the entire path. If you run into that, go into your Preferences and open Preferences > Display.

This is where you get to pick how long of a motion path you get to see. The default is 15 seconds, centered around your current time. We almost always set this to All Keyframes, so we get to see the entire motion path, no matter how long our composition is. However, if you find that's too much information that's cluttering your display, you can go back to one of these other options. But I am going to click All Keyframes for now. Note that Wiggle adds itself to the current position. You don't need to do plus value; it doesn't that automatically. So if I was going to go back to the start of my composition, I am going to turn off my Post-Expression Graph for now, move my gizmo down into the lower-left corner.

Now if I can turn off the Wiggle expression, so I get a true idea of where he really is, enable keyframing for position, press End to go to the end of the composition, drag him up to the upper right, now I have a very slow animation from the lower left to upper right. Turn the Wiggle expression back on and now he will wiggle along that path. So Wiggle can be used as an offset to create say shaky-cam effects or just more natural random movements.

If I want to see that path, I enable the Post-Expression Graph, and now I see my new modified path, and we'll preview again. Or you just drag the Current Time Indicator along the path to see what's going on. This is another case where the Graph Editor also comes in really handy to visualize what's happening. I am going to enable the Graph Editor. I have my Post-Expression Graph already turned on. If it was turned off, I would just get my flat animation, but now that it's turned on, I am seeing my Speed Graph for Position.

If I want to see the Value Graph for position, I need to go down here underneath Graph Type and change it to Value Graph. I want to see how my red and green lines for my X and Y position values are changing over time. The straight lines are my keyframed position. The curvy lines are with the expression added in. And again, I could turn off that graph or turn it on to see the results. RAM Preview and now you get a graphic representation of what's happening with the wiggle.

I'll turn that off for now. Position is not the only parameter you can wiggle. In fact, you can wiggle virtually any parameter. If you can keyframe it, you can apply an expression to it, and in virtually all cases, that means you can wiggle it. So I am going to type Shift+Plus+R to Reveal Rotation, Option+Alt+Click on the stopwatch to enable expressions. Type wiggle, open parentheses, how fast? Let's do a slow Rotation of 0.5 wiggles per second, or a wiggle gyration every two seconds, comma, and let's wiggle by 45.

The value is always the natural value range of the parameter. Close parentheses, press Enter, and now that only is this little guy flying along his path, he is also rotating randomly as well. He is looking a little bit drunk now, if you ask me, or maybe it's just a high wind. If I want to see him just centered in the screen, I'll just go ahead and turn off my keyframes for Position, but the expression is still enabled unless I was to turn that off as well. Now we'll see him sit in one place and rotate around.

One more thing about Wiggle is that it randomizes based on the layer number of the comp you are in. So if I was to take this gizmo and duplicate him, not only do I have two gizmos, they're each wiggling differently from each other. And you start going crazy and just hit Command+D or Ctrl+D to create a whole swarm of these guys moving around all together, and this creates a lot of fun. That's indeed what we did in the finished composition 05-Wiggle_final. Press Home, RAM Preview. We gave a background, just make life more interesting.

This gives you an idea of how you can quickly create swarming complex animations with a minimum amount of effort on your part. Well, some of you at this point are probably torn. You go, you know this is looking like a lot of fun, but it does require me to type in code, and it does require me to remember how the wiggle expressions has formed. Well, in this case you have a way of cheating. Sometimes cheating is good. I will turn off the expressions, and then I go over to the Effects & Presets panel, twirl open the Animation Presets, then twirl open the category know as Behaviors.

I'll go ahead and drag this a little bit wider so you can see these names. Down at the bottom of Behaviors there is a whole set of wiggle presets you can apply to your layer. For example, if you want to wiggle the position, select for layer and then either double-click this or drag it onto your layer, zero to RAM Preview, and now once again, you've got your gizmo wandering around the screen. But this time, rather than having code, you actually have what looks like an effect. We've got a controller effect up top where you get to enter Wiggle Speed and Wiggle Amount, and underneath is the Transform effect that's using to actually perform the movement.

Those who watched the previous After Effects Apprentice lesson on nesting and pre-composing, saw that we love the Transform effect. You can do a lot of stuff with it. You can go on and add Wiggle Rotation on top of that and add that added in as well. There are several other ones, Scaling, Wigglerama, which has a bunch of parameters, et cetera. Now one nice thing about these behaviors is that you do get this user interface where you get to scrub a value interactively, rather than having to retype it down on the Timeline panel, and you get to keyframe it.

Well, in the next movie, I am going to show you how you can add a user interface and to build the keyframe to an expression you write. You don't need to rely on a preset.

Find answers to the most frequently asked questions about After Effects Apprentice 09: Expressions.


Expand all | Collapse all
please wait ...
Q: This course was updated on 11/29/2012. What changed?
A: We have added exercise files designed for After Effects CS6. We also added a movie that shows our premium subscribers how to use the exercise files.
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed After Effects Apprentice 09: Expressions.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Notes cannot be added for locked videos.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.