Now, we're going to take a look at copy, pasting, and linking expressions in After Effects.
The standard copy and paste technique goes something like this.
You open a property that you want to apply an expression to, and you apply an expression.
Now, you edit the expression, I'm gonna use something like wiggle(2, 10)
Then, you're gonna select the expression text, and copy it to your clipboard
using "Control + C" or "Command + C" on a Mac.
Now, with that copied, you're gonna go to the next layer, open up the property you want to paste
add a new expression, and paste using "Control (or Command) + V"
Say I wanted to do the Planet layer now, so I'm gonna open that one up
and paste it to that one as well.
But this can get really time-consuming, especially with a large number of layers.
The more efficient way of duplicating expressions goes something like this.
Open a property that you want to affect.
In this case, I'm gonna hit "S" on the Rocket Null layer to open Scale.
And add a new expression.
I'm gonna use wiggle(2, 20) and now I'm gonna highlight the property name here in the Timeline,
right-click, Copy Expression Only.
And what this is gonna do, is it's gonna copy the expression, and it's gonna remember the
property that it was applied to.
It's not going to copy any keyframes, so it will ignore all keyframed values on this property.
So I'm gonna come down to the properties I want to affect, and I'm gonna hit "S" on my keyboard
to open up Scale, just so we can see the value change.
You don't actually have to open Scale for this to work.
And I'm gonna use the keyboard shortcut "Control + V" or "Command + V" on a Mac, to paste.
And you'll see that now it's applied, automatically, the expression to Scale for both of these layers,
and you see that the values have already been affected.
This is a really efficient way for copying one expression to multiple properties
and having it automatically recognize which property it needs to apply it to.
When linking properties to each other with expressions, there's another option
besides the Pick Whip tool.
If you open a property you want to use as a link, and select the property in the Timeline,
you can come up to Edit > Copy With Relative Property Links
Selecting this option creates a reference to this property using an expression.
So now, if I navigate to another property, in this example, I am gonna use Rocket Null,
and hit "S" on my keyboard to open up Scale, just so we can see what's happening.
And I'm gonna use the keyboard shortcut "Control + V" or "Command + V" on a Mac to paste.
And you'll notice the expression has been applied.
So if I twirl this down, you'll see a reference thisComp.layer("Planet").transform.scale
And this technique does the same thing that pick whipping does.
If I grab this pick whip and come down to Scale, you'll notice that the expression is
the exact same before.
So this is just another way to Pick Whip a value.
What if you have a situation where you want to link to a property inside of another composition?
This is where the Copy With Property Links becomes very useful.
So, to illustrate this, I'm just gonna duplicate our "Introduction" composition.
And I'm going to rename this "Alt" and I'm going to open it up.
So we have two duplicate comps here.
Now the "Alt" composition is what I'm going to use to control the "Introduction" composition.
So if I come down and highlight Rocket Null, and hit "R" on my keyboard to open Rotation,
I'm gonna work with Z Rotation.
So if I highlight Z Rotation here in the timeline, I can now come up to Edit > Copy With Property Links.
Selecting this will create an absolute link to this property,
no matter what composition you're in.
And it will copy it to your clipboard.
So now, if I come over to the original "Introduction" composition, and highlight Rocket Null,
I'm gonna hit "R" on my keyboard just so I can see what's going on here with the values.
And I'm just gonna use "Control + V" or "Command + V" on a Mac to paste.
And now, what you'll notice, is that the expression has been applied to the Z Rotation property only.
And if I twirl this down, we now see a reference, comp("100: Introduction Alt")
which is the composition we were just in.
layer("Rocket Null").transform.zRotation
That's kinda cool, it's got a dynamic link from one composition to the next.
So if I come back to the "Alt" composition and adjust this value,
I'm just gonna change it to 90.
So now we see the Rocket here is rotated around the Planet slightly.
And if I come back to the "Introduction" comp, this Rocket has done the same thing.
The Z Rotation in the original comp is at 90, just like the "Alt" composition's Z Rotation property.
This method is extremely useful for working in nested compositions or templates,
and linking cameras or layers together within nested comps.
We've arrived at the end of Lesson 105: Copy, Pasting, & Linking Properties
If you enjoy this expressions course, consider purchasing the paid content.
It includes in-depth documentation, extra tutorial content, high definition videos,
and all the project files used in the training.
Your purchase will help to create more free courses like this in the future.