Do you need to easily control one or multiple layers in your Adobe After Effects composition? You can do this by adding expression controls to null objects. In this video, author Nick Harauz guides you through how you can use expression controls with null objects to control one or multiple layers within a composition in After Effects.
- In the last few movies, we've taken a look at the basics of using null objects. In this movie, we're going to explore adding expression controls to null objects and how we can use them to control a layer or multiple layers within the composition. I have a lovely shape layer here containing two assets in the shape layer. So if I break it down, I've got one group which has one of these rings, and then I have another group that has another ring. And I'd like to have a layer kind of control some random animation here of the rings to set up a control layer, so to speak, and control the values that I am talking about under each of these groups.
So if I go into group two, the properties that I'm actually referring to are the Start, End, as well as Offset value. I'd like to have some random animation, in fact, potentially even wiggle those properties. And I'm going to have a controller. So let's set up the controller to do that. I'm going to go the Layer menu and choose New, Null Object. And let's rename that null right away. We'll call it Controller. And on the controller, we're going to add some expression controls and we're going to link some of those trim values to the expression control.
So, let's go to the Effect menu and let's head down to Expression Controls and add the Slider Control. This slider is, in fact, going to control the Start, End, and Offset value. So, how do we link these properties? The easiest way to do that is to, first of all, Option-click the Start parameter and I'm going to pick whip it. Now, I would like to pick whip it to the Controller. So, an easy way to do this actually is select the controller and usually in the Effect Controls, when I'm doing pick whipping or expressions, I like to lock panel.
So, I'm going to lock this panel out. Let's Option-click this Start area here and let's pick whip that to the Slider. Now, this Slider is going to essentially control the Start parameter, but we're just going to call it Wiggle. So, Wiggle, and let's just see what we have here. First of all, as I move this, it's going to control that Start value but it's also going to control the End value and the Offset all at once.
Now I want this value to be wiggled and a way to do that is, first of all, I could add a wiggle expression to this Slider and that Start value would wiggle throughout time. But I could also add a wiggle to the expression under the trim value. And how I'm going to do that is I'm just going to put the word Wiggle in front of the expression control. So, I'm just typing in Wiggle and I'm going to basically put this in a circular bracket and just here at the end, I'm going to take the value of the Slider and whatever that value is, I'm going to divide it into the two wiggle parameters that I want.
So, let's make a wiggle value of 2,20 cuz the wiggle takes a minimum of two values all the way up to five. Now, you'll see that expression was accepted. So, what's going to happen is it's going to take whatever the Slider value is and divide it by a wiggle value of 2,20 so this item or this Start property starts to wiggle. And it's all going to be controlled by the expression control. So let me just enter a value of 10. And right away, we can see here that that value is wiggling excellent.
So, once I have an expression control that I like, a great thing to do is to copy it onto the other layers that you also want to be affected by this wiggle. So I'm going to select the Start parameter and I'm going to go to the Edit menu and I'm going to make sure to Copy Expression Only. I'm going to go to the End value and go Edit, Paste. I should see that an expression is written on the End value. I'm just going to repeat that step to the Offset value as well, Edit, Paste. And I can see here that these three values are being controlled by this one slider.
Now, I can customize this even further. I'm going to go into the End value and let me just hit the tilde key to make my timeline a little bit bigger. I'm going to switch these values out. So, what I'd like to think about is that these two values represent two things. How often does the wiggle happen? And how much does it wiggle by? So how often, how many times per second? And how much does it wiggle by? I'm just going to up the how often and I'm going to also bring down the how much. So, I'm going to change that value also with the Offset here.
This is just being wiggled again. Just to add some more random values, I'll do six times per second. Let's do a more aggressive value of 40. I'm going to press the tilde key to make that slow. And if we go here to our project, we can see here that this is all being controlled by this one wiggle expression control. And I can come here and then switch the value and it's going to randomize those values too. Even better, I can take this value, the Start value and then connect it to the other circle as well.
So, the idea is that we have one universal controller for everything. So, I'm going to take the Start value again. I'm going to go to Edit menu and I'm going to copy this expression. I'll close out this value and I'm going to copy it to group one which contains the other circle. I'll open up the Trim settings cuz this is what I want to effect. I'll click the Start, Command+V, End, Command+V, Offset, Command+V. And if I need to, I'm going to offset those as I see fit. And you can see here that we have some random wiggle animation all controlled by one slider but some organicness happening to by playing around with the wiggle value on the parameters under trim.
Take a second here to see one example of a intermediate expression control. That's so we added a wiggle slider to control the wiggle of these two rings. In the next movie, we're going to take a look at the lovely interpolation command and that is linking parameters of one layer to another although that their arrays might not match up.
- Creating text animation presets
- Creating custom vignette and fractal noise presets
- Creating a custom texture library
- Using a null object to control layered graphics
- Using the interpolation expression to link values
- Setting up a Universal Color Control
- Using prebuild expressions to drive camera animation and depth of field
- Creating a control layer to delay layer animation
- Saving your control layers and expressions