3: After Effects Expressions For Beginners: Linking Properties with the Pick Whip
Linking is where after effects expressions shine. One layer's rotation drives another layer's position. A single color updates twelve text layers. A duplicated comp keeps its internal links instead of pointing back at the original. Getting there takes one tool, two menu commands, and some discipline about naming things.
Linking properties with After Effects expressions and the pick whip
The pick whip is the spiral icon that appears under any property with an expression. The whole workflow:
Alt-click (Windows) or Option-click (macOS) the stopwatch on the property that should follow. Say, the Scale of Layer B.
Press and hold the spiral icon.
Drag. A line follows your cursor.
Release over the property it should follow, like Layer A's Scale.
After Effects writes the expression for you. No typing.
The same insertion rules as the Expression Language menu apply. If your cursor sits inside existing expression text, the pick whip inserts at that spot. If part of the expression is selected, it replaces the selection. If your cursor isn't in the field at all, it replaces everything.
Dropping on the name vs. dropping on a single value
Where you let go matters.
Drop onto the property name ("Position") and you get the whole property:
thisComp.layer("Layer 1").transform.positionDrop onto one of the numbers, say the Y value of Position, and After Effects writes something a bit more interesting:
temp = thisComp.layer("Layer 1").transform.position[1];
[temp, temp][1] means "the second value". Counting starts at 0 in JavaScript, so X is [0] and Y is [1]. Both dimensions of your property now follow that one number.
That's handy for Scale, where you often want a uniform link to a single value. For Position it's rarely what you want, so drop on the name unless you have a reason not to.
Name your layers before you link anything
Expressions reference layers by name. thisComp.layer("Layer 1") gets shaky the day there are two layers called "Layer 1" or you decide to precompose that layer later on.
After Effects tries to help. If you pick whip onto a layer that shares its name with another layer in the same comp, it renames the target by adding a number, so the reference stays unique. Thoughtful, but it also means your tidy "Title" layer quietly becomes "Title 2". And when you rename layers later, After Effects tries to update the expressions that point at them. Usually that works. Sometimes it doesn't.
My rule: name every layer that anything links to before you create the link. "CONTROLS", "BAR_01", "Logo". Boring names win.
Compact English: leave it on
The pick whip has a preference that's easy to overlook: Expression Pick Whip Writes Compact English. It lives in the preferences under Scripting & Expressions and is on by default.
With it on, you get:
thisComp.layer("Layer 1").transform.positionWith it off:
thisComp.layer("Layer 1")("Transform")("Position")The compact version uses internal names for built-in properties, and those work no matter which language After Effects runs in. The long version uses display names, which change with the interface language. Adobe says you can turn it off if the project will never be opened in another language. I'd leave it on anyway. Templates travel, and you don't know whether the next person runs After Effects in English, German or Japanese.
Copy With Property Links vs. Copy With Relative Property Links
The pick whip handles one property at a time. For groups of properties, or entire layers, use the Edit menu. Select the properties and choose either:
Edit > Copy With Property Links
Edit > Copy With Relative Property Links
Then paste onto any layer. The pasted properties are now linked to the originals, and changes to the source carry over. You can also copy an entire layer with property links and paste it to create duplicates that follow the original.
The two commands write different expressions. Copying Position with relative links gives you:
thisComp.layer("control_layer").transform.positionThe regular version gives you:
comp("source_comp").layer("control_layer").transform.positionThat's not a cosmetic difference.
Relative links point to thisComp, meaning whichever comp the expression currently lives in. Duplicate that comp, and the links point to layers inside the duplicate. That's what you want for templates, lower third variants, or anything you build once and duplicate ten times.
Regular links point to a specific comp by name. Duplicate the comp, and every copy still listens to the original. That's what you want for a master control comp: brand colors, global timing, one "CONTROLS" comp that runs a whole project.
Mix them up and you get eight lower thirds that all change when you edit the first one. Ask me how I know.
Finding linked properties later
Linked projects get hard to read fast. Three things help:
Press E twice with layers selected to show only properties that have expressions.
The Timeline search field searches expression text too. Type a layer name and every property referencing it shows up, along with its layer and property group.
The Graph Editor (Shift+F3) can show the expression field at the bottom for the selected property. Enable Show Expression Editor in the graph options menu. Turn on Show Post-Expression Graph and you'll see a faint curve (the value before the expression) next to a bright one (what the expression actually outputs). For Position, the motion path in the Composition panel updates to show the expression-driven path as well.
Reusing expressions without retyping them
Copy Expression Only. Select the source property, choose Edit > Copy Expression Only, select the target properties, and paste. No keyframes come along. It's the fastest way to put the same expression on 20 layers. If you're pasting between different property types, like Position onto Scale, select the target property explicitly. After Effects can't guess that one.
Animation presets. Select the property with the expression and choose Animation > Save Animation Preset. It's saved to your User Presets folder, and you can drag it from the Effects & Presets panel onto any layer. If the property has keyframes, they're saved too. If it only has an expression, only the expression is saved. The catch: if the expression references a layer or effect that doesn't exist in the new project, it'll throw an error.
Custom functions. You can write your own functions with regular JavaScript syntax, but each function has to be defined inside every expression that uses it. There's no global function library you can register them in. Newer versions of After Effects do let you import a .jsx file as footage and pull functions from it with footage("file.jsx").sourceData, which is a much cleaner way to share code across a big template. Worth exploring once you catch yourself pasting the same function for the fifth time.
Up next
Part 4 builds on all of this with Expression Controls: sliders, checkboxes, color pickers and dropdowns that turn your linked properties into an actual control panel. It's also the foundation of pretty much every MOGRT.