Reuse an Expression Anywhere
The expression you wrote last month, working on today's project, without rewriting the layer names in it.
The task
- Keep the expression somewhere you can find it again.
- Find it later, by something other than remembering the file name.
- Apply it to a different rig — which means pointing it at this project's layers.
- Hand it to someone else.
How it goes in plain After Effects
- Save it as text, in a notes app or a
.txtfile beside the project. Finding it later means remembering what you called it. - Or save an animation preset: select the property, Animation → Save Animation
Preset…, and it writes a
.ffxinto AE's Presets folder. It comes back through the Effects & Presets panel, searchable by name. - Re-point it by hand. A preset carries the expression text as written — every
thisComp.layer("Ctrl")in it still names the layer from the project it came from, so applying it in a new project means editing those names in the expression field. - Share by handing over the
.ffxor the text.
i
Both routes work. What neither does is re-connect the expression's layer references to the project it just landed in — that stays a manual edit, every time.
What changes with eXLib
The library is the place, and apply-time connection is the mechanism.
Saving:
- Save on the toolbar captures the editor — plus this session's variables and controls — as an Author draft.
- Give it a title, description and tags in Author; those are what search matches later.
- Choose a Publish target folder and Publish to library.
Finding:
- Search matches title, description, tags and code — so "the one with the wiggle on scale" is findable even when you've forgotten its name.
- Filter by folder, pack or tag, and narrow to what fits your current selection with the Selected property chip.
Applying into a different rig — the part plain AE leaves manual:
- Every layer reference the expression needs can be a variable rather than hard-coded text. Wire it to Ask on apply and it is asked for at the moment you apply, not baked in.
- When apply runs, a Connect variables panel lists exactly the rows that still need an answer, with a source picker per row and a live status as you fill them in. Answer them, press Apply, and eXLib splices the real references into the code for you.
- How often you see that panel is a setting: Settings → Applying → Checking level — Guide me confirms every source on every apply, Errors only (the default) asks only about what would fail, Expert applies and reports afterwards, Leeroy Mode doesn't ask.
✓
A warning never blocks an apply — only a variable with nothing resolvable does. The panel counts warnings, states them in words, and leaves Apply enabled.
Sharing:
- Settings → Backup & restore → Back up / export library… writes the whole library to
one portable
.exlibfile; a folder row exports just that folder. - On the other machine, Import / restore archive… reads it back. Import is additive, and anything that collides is yours to resolve — Keep mine, Keep both, or Take theirs.
Step by step
| Step | In plain After Effects | With eXLib |
|---|---|---|
| 1. Store it | A .txt beside the project, or Animation → Save Animation Preset… |
Save on the toolbar → an Author draft |
| 2. Describe it | The file name | Title, description and tags in Author |
| 3. File it | A folder in Finder/Explorer, or AE's Presets folder | Publish target folder → Publish to library |
| 4. Find it again | Remember the name; search Effects & Presets by name | Search over title, description, tags and code; filter by folder, pack, tag, or the selected property |
| 5. Apply it here | Apply the preset, or paste the text onto the property | The row's Apply action, against your live selection or the tab's pin |
| 6. Point it at this project's layers | Edit the layer names inside the expression, per reference | Answer the Connect variables panel — pick the layers, eXLib writes the references |
| 7. Create the controls it needs | Add and name each Expression Control by hand | Created by Apply, on the layer you chose |
| 8. Keep the original safe | Copy the file somewhere | Every launch writes an automatic backup; the newest 30 are kept, each with Restore |
| 9. Hand it to someone | Send the .ffx or the text |
Back up / export library… → one .exlib; they Import / restore archive… |