You are on page 1of 56

VISUAL EFFECTS

Module 2
Introduction to After
Effects – Part 2
Intended Learning Outcome
• Copying and Pasting Keyframes
• Setting the Parent Layer
• Working with Null Objects
• Defining the Expression
• Modifying Simple Expression
• Use of Wiggle Expression
• Pre-compositing and Nesting
Copying and Pasting Keyframes
Keyframes

Keyframes are used to create and control animation, effects, audio properties, and
many other kinds of changes that occur over time.

A keyframe marks the point in time where you specify a value, such as spatial position,
opacity, or audio volume.
Values between keyframes are interpolated. When you use keyframes to create a
change over time, you must use at least two keyframes – one for the state at the
beginning of the change, and one for the state at the end of the change.
Copy and Paste Keyframes

You can copy keyframes from only one layer at a time. When you paste keyframes into
another layer, they appear in the corresponding property in the destination layer. The
earliest keyframe appears at the current time, and the other keyframes follow in relative
order. The keyframes remain selected after pasting, so you can immediately move
them in the destination layer.

You can copy keyframes between layers for the same property (such as Position) or
between different properties that use the same type of data (such as between Position
and Anchor Point).
Copy and Paste Keyframes

Note:
When copying and pasting between the same properties, you can copy from more than
one property to more than one property at a time. However, when copying and pasting
to different properties, you can copy only from one property to one property at a time.
Copy and Paste Keyframes
1. In the Timeline panel, display the layer property containing the keyframes you
want to copy.
2. Select one or more keyframes.
3. Choose Edit > Copy.
4. In the Timeline panel containing the destination layer, move the current-time
indicator to the point in time where you want the keyframes to appear.
5. Do one of the following:
• To paste to the same property of the copied keyframes, select the
destination layer.
• To paste to a different property, select the destination property.
6. Choose Edit > Paste.
Setting Parent Layers
Parent and Child Layers

• To synchronize changes to layers by assigning one layer’s transformations to


another layer, use parenting.

• After a layer is made a parent to another layer, the other layer is called the child
layer.

• When you assign a parent, the transform properties of the child layer become
relative to the parent layer instead of the composition.
Parent and Child Layers

• Parenting affects all transform properties except Opacity: Position, Scale, Rotation,
and (for 3D layers) Orientation.

• A layer can have only one parent, but a layer can be a parent to any number of
layers in the same composition.

• You can animate child layers independent of their parent layers. You can also parent
using null objects, which are hidden layers.
Parenting

A very cool and useful feature is the Pick Whip. You can select it and drag the line to
another Layer, value or other controls (1.). This process is called Parenting. It defines
the Layer you choose as the Child (2.) of the Parent, in this case the Layer above. You
can also select a Layer from the Drop Down Menu (3.) on the right side of the Pick
Whip.
Parenting
Parenting - Example

A second ago we parented our two red squares


to each other. The upper square is the Child and
the lower square is the Parent. When we change
the position of the lower square the upper
square will imitate our changes.
Parenting - Example

Change the position of our square to the right of


our composition and watch what happens. Make
sure you select the lower square since its the
parent. If you select the upper square you won't
see the parenting effect we want to achieve.
Working with Null Objects
Null Object Layers

• A null object is an invisible layer that has all the properties of a visible layer so that it
can be a parent to any layer in the composition.

• Adjust and animate a null object as you would any other layer.

• A composition can contain any number of null objects.

• A null object is visible only in the Composition and Layer panels and appears in the
Composition panel as a rectangular outline with layer handles.

• Effects are not visible on null objects.


What are Expressions
Expression Basics

When you want to create and link complex animations, but want to avoid creating tens
or hundreds of keyframes by hand, try using expressions.

An expression is a small piece of code, much like a script— that you can plug into your
After Effects projects, that evaluates to a single value for a single layer property at a
specific point in time. However, scripts tell an application to do something, an
expression says that a property is something.
Use the Expression

The expression language is based on the standard JavaScript language, but you do not
need to know JavaScript to use expressions. You can create expressions by using the
pick whip or by copying simple examples and modifying them to suit your needs.

To open the expression controls, pick the layer property you want to affect and
hold Option on Mac or Alt on PC while you click the keyframe (stopwatch) icon. The
expressions box displays, you can use it to write. edit expfll then see the expression
options including a place to write or paste your expression. You can also use the pick
whip tool to reference another layer for your expression. And you can enable or disable
your expression here without having to delete it.
Modifying Simple Expressions
Expression Editor

You can customize the code editor interface of the expression editor, including
highlighting JavaScript syntax with custom colors, line numbers, code folding, and auto-
complete.
To customize these options, select Preferences > Scripting and Expressions.
Expression Editor

Scripting and Expressions dialog


Expression Editor
See the example below to understand how the editor works:

Example 1: Display error in your code snippet.

1. Open a comp in After Effects that has expression snippets.


2. In the Timeline panel, select a layer and do Alt+Click. It displays the expression in the
expression editor field.

Expression Editor field


Expression Editor
3. Click the editor field to enter the edit mode.

Click in the editor to enable editing in the Expression Editor


Expression Editor
4. In this example, select MILE in the first line, and change it to mile in lowercase. This
triggers an error in the code, and After Effects displays an error message within the
code snippet.

Error message displayed in the code snippet


Expression Editor
After Effects also displays an error banner with details about the Line number where the
error occurs.

Error banner
Expression Editor
Example 2: Auto-suggestions based on the commonly used components.

1. In the same expression, change the layer name from mile to MILE.
2. As you type, After Effects displays a drop-down list with a set of suggestions that After
Effects pulls from the layer names of the project..

Layer name auto-suggestions


Add, Disable, Link, or Remove an Expression

• To add an expression to a property, select the property in the Timeline panel and
choose Animation > Add Expression or press Alt+Shift+= (Windows) or
Option+Shift+= (Mac OS); or Alt-click (Windows) or Option-click (Mac OS) the
stopwatch button next to the property name in the Timeline panel or Effect Controls
panel.

• To temporarily disable an expression, click the Enable Expression switch .


When an expression is disabled, a slash appears through the switch .
Add, Disable, Link, or Remove an Expression

• To remove an expression from a property, select the property in the Timeline panel
and choose Animation > Remove Expression, or Alt-click (Windows) or Option-click
(Mac OS) the stopwatch button next to the property name in the Timeline panel or
Effect Controls panel.

• To link a set of properties across layers and compositions, use property links.
Select any one property or set of properties and choose Edit > Copy With Property
Links or Edit > Copy With Relative Property Links, and then paste those properties
on any layer in a composition.
Add, Disable, Link, or Remove an Expression

The pasted properties remain connected to the layer from which the properties were
copied, such that any change made to the original property is reflected in all of the
instances of the pasted property links.

You can even copy an entire layer with property links and paste it to create duplicates
that follow the changes made to the original.
Edit an Expression Manually

1. Enter the text-editing mode by clicking in the expression field.


Note:
When you enter text-editing mode, the entire expression is selected. To add to the
expression, click within the expression to place the insertion point; otherwise, you will
replace the entire expression.

2. Type and edit text in the expression field, optionally using the Expression
Language menu.
Note:
To see more of a multiline expression, drag the bottom or top of the expression field to
resize it.
Edit an Expression Manually

3. To exit text-editing mode and activate the expression, do one of the following:

• Press Enter on the numeric keypad.

• Click outside the expression field.


Edit an Expression with the Pick Whip

If you are not familiar with JavaScript or the After Effects expression language, you can
still take advantage of the power of expressions by using the pick whip. You simply
drag the pick whip from one property to another to link the properties with an
expression, and the expression text is entered in the expression field at the insertion
point.

If text is selected in the expression field, the new expression text replaces the selected
text. If the insertion point is not in the expression field, the new expression text replaces
all text in the field.
Edit an Expression with the Pick Whip

You can drag the pick whip to the name or value of a property. If you drag to the name
of a property, the resulting expression displays all the values as one. For example, if
you drag the pick whip to the name of the Position property, an expression like the
following appears:
Edit an Expression with the Pick Whip

If you drag the pick whip to one of the component values of the Position property (such
as the y value), an expression like the following appears, in which both the x and y
coordinates of the property are linked to the y value of the Position property:
Edit an Expression with the Pick Whip

If the layer, mask, or effect that you drag the pick whip to does not have a unique
name in its local context, After Effects renames it. For example, if you have two or
more masks named “Mask” on the same layer, and you drag the pick whip to one of
them, After Effects renames it “Mask 2."
Edit an Expression with the Pick Whip

The format of expressions created by the pick whip is determined by the Expression
Pick Whip Writes Compact English preference (Edit > Preferences > General
(Windows) or After Effects > Preferences > General (Mac OS)).
By default, the pick whip creates compact English expressions, which use the names
for properties as they appear in the Timeline panel for the properties within an
expression.
Because these names are coded into the application and never change, these
expressions can work when After Effects is running in another language. Any property
names that you can change are enclosed in double quotation marks and remain the
same in any language.
If you don’t plan on sharing your projects across languages, you can deselect this
preference. This preference does not affect effect names or effect properties.
Edit an Expression with the Pick Whip

Here is an example in compact English:

Here is the same expression, not in compact English:


Using the Wiggle Expression
Wiggle Expression

If you’ve ever seen animations where light is flickering or a camera shakes, it’s likely
you’ve seen the wiggle expression in action.

Wiggle is one of the most popular After Effects expressions, as it is easy to use and
visually interesting. Instead of creating a bunch of keyframes to make a layer randomly
move, we can do this with a couple of numbers.

The Wiggle Expression in After Effects (or ae wiggle for short) is a great way to make
objects move randomly, have some sort of idle Movement in character joints, animate a
random camera shake, create wobbly text or animate a blinking/flickering light.
The Wiggle Expression in After Effects.

Basic After Effects Wiggle Expression (explained):

wiggle(freq, amp, octaves=1, amp_mult=.5, t=time)

//freq being the frequency, so how often per second the value should wiggle //amp being the
amplitude, so how far the value should wiggle
//octaves is the number of octaves of noise to add together.
//This value controls how much detail is in the wiggle.
//Make this value higher than the default of 1 to include higher frequencies or lower to include
amplitude harmonics in the wiggle.
//amp_mult is the amount that amp is multiplied by for each octave.
//This value controls how fast the harmonics drop off.
//t is the base start time.
The Wiggle Expression in After Effects.

Wiggle Expression Examples

//wiggle far but slowly


wiggle(1.2, 700);

//wiggle a bit faster but not so far


wiggle(3, 20);

//wiggle fast but not far


wiggle(11, 7);
The Wiggle Expression in After Effects.

Making wiggle start and stop at specific times


//If your wiggle expression should start at 3 seconds
timeToStart = 3;
if (time > timeToStart){
wiggle(3,25);
}else{
value;
}

//If your wiggle expression should stop at 10 seconds


timeToStop = 10;
if (time > timeToStop){
value;
}else{
wiggle(3,25);
}
The Wiggle Expression in After Effects.

Making wiggle start and stop at specific times

//If your wiggle expression should start at 5 seconds and stop at 15


seconds
timeToStart = 5;
timeToStop = 15;

if ((time > timeToStart) && (time < timeToStop)){


wiggle(3,25);
}else{
value;
}
The Wiggle Expression in After Effects.

Tell the wiggle expression to only wiggle in one direction


//wiggle only in x (horizontal):
org=value;
temp=wiggle (5,50);
[temp[0],org[1]];

//Shorthand:
[wiggle(5,50)[0],position[1]]

//wiggle only in y (vertical):


org=value;
temp=wiggle (5,50);
[org[0],temp[1]];

//Shorthand:
[position[0],wiggle(5,50)[1]]
Pre-compositing and Nesting
What is Precomposing?

• Precomposing is the process of packaging a series of layers into a new


composition in After Effects. In a way it's the same as grouping layers in
Photoshop.
• By grouping these layers together you can add animation, effects, or masks that
will then be applied to all of the layers within.
What is Precomposing For?

Precomps are used mainly to help organize complex compositions. But let’s take a
look at some of the specific reasons to use a precomp.

• Precomps can organize your timeline by grouping certain layers together, freeing
up room in the timeline and making it easier to navigate a complex composition.

• You can build an animation in one composition and then add that composition to
another. This is also known as nesting.

• Precomposing allows artists to apply keyframes, effects, and other layer changes to
a precomposition layer, and therefore affect all of the grouped layers within.
How to Precompose

Here's how to Precompose in After Effects:

• Highlight the Layers You Want to Precompose.

• Navigate to Layer > Precompose.

• Name Your Precomp, Select Your Options, and Click 'OK’.

Tip: To access your original layers double-click the pre-comp.


What’s the Difference between Precomposing
and Nesting?

• As you can see precomposing layers in After Effects is a pretty simple process.
And it can definitely be used to great effect when working in complex compositions.

• But remember that when working with these complex compositions you’ll find that
it's usually beneficial to add an existing composition to another composition. This
process is called nesting.

• While precomposing is the process of placing a group of layers into a new


composition, nesting is placing an existing composition into the timeline.
What’s the Difference between Precomposing
and Nesting?

A more complex composition with nesting.


Uses of Precomposing and Nesting

Precomposing and nesting are useful for managing and organizing complex
compositions:
– Apply complex changes to an entire composition

– Reuse anything you build

– Update in one step

– Alter the default rendering order of a layer

– Add another set of transform properties to a layer


– Because a precomposition is itself a layer, you can control its behavior using

layer switches and composition switches in the Timeline panel.


REFERENCES
▪ Adobe, 2020. Effects and Animation Presets Overview. https://helpx.adobe.com/after-
effects/using/effects-animation-presets-overview.html
▪ Motion Array, 23-Jan-2020. Learn the Basics of Animation in Adobe After Effects. Retrieved from
https://motionarray.com/learn/after-effects/after-effects-animation/
▪ Bloop Animation, 2020. Animate CC vs. After Effects. Retrieved from
https://www.bloopanimation.com/animate-cc-vs-after-effects/
▪ Robinson, I, Lynda.com, 6-Sep-2013. Getting to know the Basics of Animation. Retrieved from
https://helpx.adobe.com/after-effects/how-to/aftereffects-understanding-animation-cc.html
▪ MMP260-1301, Introduction to 2D animation, Spring 2019. After Effects: Basic Transform Properties.
BMCC OpenLab. Retrieved from https://openlab.bmcc.cuny.edu/mmp260-1301-s2019/after-effects-
basic-transform-properties/
▪ Ward, C. How to Move the Anchor Point in After Effects. School of Motion. Retrieved from
https://www.schoolofmotion.com/blog/anchor-point-in-after-effects
REFERENCES
▪ Motion Island. How to Move Anchor Point in After Effects?. Retrieved from
https://blog.motionisland.com/how-to-move-anchor-point-in-after-effects/#.Xwsv1CgzZPY
▪ Motion Islang. How to center your anchor point and layer in an After Effects composition. Retrieved
from https://blog.motionisland.com/how-to-center-your-anchor-point-and-layer-in-an-after-effects-
composition/#.XwsydSgzZPY
▪ Adobe After Effects User Guide, 2020. Retrieved from https://helpx.adobe.com/ca/after-
effects/using/animation-basics.html
▪ Adobe After Effects User Guide, 2020. Expression Basics. Retrieved from
https://helpx.adobe.com/ca/after-effects/using//expression-basics.html#about_expressions
▪ Asbury, C. 30-Jan-2013. Using Wiggle to Create Random Movement in After Effects. Premium Beat by
Shutterstock. Retrieved from https://www.premiumbeat.com/blog/after-effects-wiggle-expression/
▪ Glawion, A, 19-May-2020. How to Use the After Effects Wiggle Expression. CGDirector. Retrieved from
https://www.cgdirector.com/after-effects-wiggle-expression/
REFERENCES
▪ Adobe After Effects User Guide, 2020. Precomposing, Nesting, and Pre-rendering. Retrieved from
https://helpx.adobe.com/after-effects/using/precomposing-nesting-pre-rendering.html
▪ Paul, J.. A guide to Precomposing in After Effects. School of Motion. Retrieved from
https://www.schoolofmotion.com/blog/precomposing-in-after-effects
▪ Boone, J., 18-Ocy-2017. How to Perfectly Position Assets in Adobe After Effects. Premium Beat by
Shutterstock. Retrieved from https://www.premiumbeat.com/blog/position-assets-adobe-after-
effects/
▪ Kajik, 7-Jan-2009. After Effects for Beginners: Effects and Animation. Envato Tuts+. Retrieved from
https://cgi.tutsplus.com/tutorials/after-effects-for-beginners-effects-animation--ae-206
▪ Adobe After Effects User Guide, 2020. Editing, Moving, and Copying Keyframes. Retrieved from
https://helpx.adobe.com/after-effects/using/editing-moving-copying-keyframes.html

You might also like