Check out the new audio content!
By using the wiggle() expression you instantly bring your animation to life without additional work. For example, use the wiggle expression on idle character animation like eyebrows, to add a slight up and down movement.
How to use wiggle() for eyebrows
Right click the position property and choose the menu item “Seperate Dimensions”. Once enabled, you will see X Position and Y Position appear as separate properties. Hold ALT and click on the stopwatch left of the Y Position property to open the expressions field. Write wiggle(0.5,20) in the expressions field and click somewhere outside of the field to close the expression or hit Enter on your numPad/extended keyboard.
Link to Slider Controls
By linking your expression values to slider controls, you can easily adjust values within an expression without having to access the expression field.
Open Effects & Presets and add a slider control to your layer. Highlight an existing value in the expression or click inside the brackets and click & drag the pickwhip (the spiral symbol) to the slider control property. Make sure your slider controller is toggled open in the effects menu of the corresponding layer.
Slider controls allow you to adjust expression values on any number of layers linked to the same slider. Right click the property with the expression and choose Copy Expression Only, paste to another layer.
Copy/Paste an Expression
Slider controls allow you to adjust expression values on any number of layers linked to the same slider. By linking values to sliders, you can copy/paste the expression to other layers and adjust values simultaneously for all the layers linked to the same sliders.
Right click the property and choose Copy Expression Only. Highlight another layer and hit CTRL+V to paste the expression to the layer. The expression is automatically pasted to the same property it was copied from. If you want to paste the expression to a different property on another layer, make sure to highlight that layer’s property first. If you copied an expression from a Separated Dimension, make sure to perform this step first before pasting the expression.
Clean Up Your Code
By adding variables and linking your slider controls to them, you instantly achieve a much cleaner final statement.
Variables are unique words that are used to assign data values. Variables can be made up of case sensitive letters, numbers, underscores and dollar signs but cannot start with a number. Write a variable with any of the aforementioned, followed by an equals sign, then pickwhip to your slider control and close the statement with a semi-colon.
Once your slider is assigned to a variable you can use that variable in any following statement such as wiggle(freq,amp).
//add to position property
freq = thisComp.layer("WIGGLE_ctrl").effect("frequency")(1); //link to slider, frequency
amp = thisComp.layer("WIGGLE_ctrl").effect("amp")(1); //link to slider, amplitude
wiggle(freq,amp) //wiggle in both directions
The wiggle() expression chooses random values within your defined range. By using Dan Ebbert’s wiggle loop, you have more control over the animation and can create a seamless loop.
freq = 1;
amp = 110;
loopTime = 3;
t = time % loopTime;
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
linear(t, 0, loopTime, wiggle1, wiggle2)
Want to Master Expressions?
Join my Motion Graphics Template Course. Enrol Today!
Personalise branded graphics for your YouTube or talking heads video. Learn new and advanced expressions and create responsive, modular templates.