Part Three: Setting Up the Other Layer

Well, the expression worked. The layer wiggles, which might work for many projects. However, what if we need more control? What if we want to ANIMATE THE EXPRESSION? In order to do this without pulling all our hair out, we will need to use a separate layer. We will turn to the WIGGLE_CONTROL layer.

Select the WIGGLE_CONTROL layer and apply Effect-->Adjust-->Threshold to it.
(we aren't going to use this as an effect. We are going to use the Threshold effect's LEVEL slider to control the expression)





RIGHT-CLICK or CONTROL-CLICK on the word "Level" in the Effect Control window.
(don't click "Threshold"; it will bring up the wrong menu)
Select "Edit Value..."




Change the SLIDER RANGE (not the value) to 0 to 200




Duplicate the effect. Be careful not to duplicate the entire layer.
(by pressing F2, you will deselect all. Then click on the word "Threshold" in the effects control window. Then duplicate.)




RENAME THE EFFECTS:
Select the top "Threshold" and press the 'return' key (not the enter key)
Rename the effect "frequency"
Rename the second Threshold "amplitude"




In the timeline, show the effects on the WIGGLE_CONTROL layer.
(select the layer and press the 'e' key)


At this point your timeline should look like this:






Part Four: Giving Control to the Other Layer

We will modify our expression to allow the WIGGLE_CONTROL layer to control the wiggle of the 'wiggle layer.'

In the wiggle layer, select the value you entered in the position expression for frequency (if you're following my numbers, you entered 10)





With the number highlighted, drag the pick whip (the little swirly thing) over the layer WIGGLE_CONTROL's frequency's "Level".
The highlighted portion of the expression will be replaced with some messy stuff, resulting in the following:





"WHAT IN THE HECK DOES THAT MEAN????"

what this ultimately means is "127", since that is the current value of the "Level" parameter under the "frequency effect.    But here's how the computer reads it:

position.wiggle( [lots of goofy stuff],20)        We've seen these parts before. (only the "goofy stuff" was a '10')

this_comp.            tells AE to look in the same composition as the expression

layer("WIGGLE_CONTROL"). 
          tells AE to look for the layer entitled "WIGGLE_CONTROL"
(this is why you should never change a layer's name after writing the expression)

effect("frequcncy").          tells AE to look for an effect entitled "frequency" (in the layer, in the comp, etc)

param("Level")           tells AE to examine the paramater of the frequency effect entitled "Level". This returns the same value "Level" has at that point in time (in this case, 127)





Do the same thing with the second variable ('20') and the Level for amplitude in the WIGGLE_CONTROL layer.



(by dragging on the bar just below the expressions, you can make it larger than just one line, so it's all easier to see)

Now set some keyframes for amplitude and frequency and watch your animating wiggle animate even more!




Click on the graphic to see a larger version.


Click here to see a sample movie.

Any questions? Please ask them in the After Effects COW.






Please visit our forums at CreativeCow.net if you've arrived at this page from a direct link.