WEEK 8: Oct 20, 2011

Class with Robert Paynter: www.robertpaynter.com

Expressions:
Expressions (written in a scripting language based on Java) can be added to all transform properties of a layer (anchor point, position, scale, rotation, opacity) as well as many of effects properties.

Adding an expression:
- select the property (click on it and make sure it is highlighted)
- go to Animation > Add Expression
- in the keyframe section of the layer's timeline, a space/window will open for typing. You can either enter an expression or click on any other part of the timeline to "deactivate" the scripting window.
- when the typing area for the expression is deactivated, you retain expression related tools on the property

Removing an expression:
- click on the expression, select it and press delete.
- you can also select the property, and go to Animation > Remove Expression


Expression tools:
Once the "add expression" option has been applied to a layer property, the expression tools will appear to the right of that property.

- Enable expression ( equal sign symbol =) allows you to de-activate/activate an expression
- Show post expression graph enables an object to express a motion path and graph representation of the expression driving it. This may help you visualize the code.
- Expression pick whip (@ symbol–also used for the parenting tool) allows you to reference (and form relationships between) the properties of the object you're affecting and another asset in the comp (see uses in the description below).
- Expression language menu (a drop down menu to the gives you access to a list of pre-made expressions.

Using the Expression Pick Whip:
- Open the desired properties of both layers
- Make sure you have "added expression" to that property of your main layer (the layer that will be driven).
- Click on the Expression Pick Whip of your main layer and drag it down to the desired expression of the driving layer. When you let go, an expression will appear in the "scripting" area of the main layer's timeline.


The Expression Pick Whip allows you to create basic expressions visually. One of the most useful applications is making a target object's property (such as position, scale, rotation, etc) equal to a value of another object's property. You can link same properties (position to position, scale to scale, etc) or mismatched properties (position to scale, rotation to opacity, etc).

Linking a property of one layer to another (vs. parenting the entire layer to another without expressions) is helpful when you only want specific properties to be affected (e.g. only position, but not rotation or scale).

Animating/Offsetting expression-driven properties:
When an object is parented without the use of expressions, you are free to animate all of its transform properties, even though they are driven by the parent object. This is not the case with expression-linked objects. If you have connected the position property of one layer to another, the "driver" and the "dirivee" will appear in the same position of a comp ("on top" of one another). The linked property of the driven layer cannot be animated or offset.

A trick to solving this problem:

- Create a Null Object (Layer > New > Null Object)
- Use an expression to connect the Null Object's property to the driver layer (instead of your main layer)
- Parent your "main" layer to the Null Object

All properties of your "main" layer remain flexible and keyable. The Null Object guarantees that, unlike expression-free parenting, only the specific property of your choice is feeding information into your "main" object.

Noteworthy expressions:

Wiggle:
The Wiggle can be applied to create randomized animation of a property

wiggle (1, 2);

- The first value represents the frequency of the "wiggle". Lower or raise this value to make your "wiggle" slower or faster.
- The second value represents the range. Lower or raise this value to make your "wiggle" subtle or extreme.

For example:
If you apply an expression "wiggle(1, 50);" to opacity (with opacity being equal to 100% before the expression) opacity will randomly fluctuate between 100% and 50% at the frequency of 1.

If you apply an expression "wiggle(5,300);" to position, your object will randomly (and continuously) move 300 around its initial position at the frequency of 5.

Cycle (Loop) Animation:
If you created an animation sequence that you want to loop continuously, add the following expression to the animated property. To affect several properties, add the expression to each.

loopOut(Type="cycle")
Note: To create a seamless loop, make sure that the values of your first and your last keyframes are equal. Check all the transform properties.

No comments:

Post a Comment