An After Effects animation engine built for expressions.
eKeys is a system of doing animation in Adobe After effects entirely within expressions, with the same level on control as keyframes.
It comes in the form of a .jsx file that's imported into the project, and a set of expressions to be applied to each property you wish to animate, with the values for each 'keyframe' to be added in the expression.
Its purpose is to speed up the creation of After Effects templates and other automated work.
eKeys is written in TypeScript using our Expression Library Template
- Animate between numbers or arrays
- Full control over easing, including incoming and outgoing velocities
- No installation necessary, just import 1 file
- Simple and succinct expression interface
- Free and open source
- Overview
- Contents
- Compatibility
- Usage
- Example
- Helpful Snippets
- By animators, for animators
- To Do
- License
- Contact
This version of eKeys is compatible with After Effects versions >= 16.0.1 (CC2019) which use the new Javascript engine.
β οΈ Make sure your project is configured to use the JavaScript engine by going toFile > Project Settings > Expression Engineand setting it toJavaScript.
For a legacy version that works in the ExtendScript engine, view the ExtendScript Branch. Please note, this version of eKeys is not actively maintained.
Head over to the releases page to download the latest version of the eKeys.jsx file.
This is the JSON file that contains the necessary code to run eKeys. You may not be able to drag and drop it into your project, in which case you will need to use the import dialog.
To reference the library in an expression, you need to assign it to a variable. This is done via the line:
const eKeys = footage('eKeys.jsx').sourceData;
β οΈ Since After Effects doesn't count footage items that are only referenced within expressions as used, it's recommended that you also place theeKeys.jsxfile in any compositions where it is referenced.This will ensure After Effects includes the file when collecting assets or packaging into a Motion Graphics Template.
Each keyframe is represented as an object within an array.
// Example keyframe array
const keys = [
{
keyTime: 1,
keyValue: [0, 0],
easeIn: 0,
easeOut: 66,
},
{
keyTime: 2,
keyValue: [thisComp.width / 2, 0],
easeIn: 90,
easeOut: 0,
},
];Keyframe Object Properties
keyTimeWhere the keyframe is in time, in seconds- Type:
number - Required:
true
- Type:
keyValueValue of the keyframe- Type:
numberorarray - Required:
true
- Type:
easeInEase in amount- Type:
number - Required:
false - Default:
33 - Range:
0-100
- Type:
easeOutEase out amount- Type:
number - Required:
false - Default:
33 - Range:
0-100
- Type:
velocityInIncoming speed- Type:
number - Required:
false - Default:
0 - Range:
0-100
- Type:
velocityOutOutgoing speed- Type:
number - Required:
false - Default:
0 - Range:
0-100
- Type:
While it is recommended you order the keyframes according to their
keyTimefor the sake of readability, it is not required as they are sorted before the animation is calculated.
The final animated value can be returned by calling the animate function.
eKeys.animate(keys, time? = thisLayer.time);keysArray of keyframes- Type:
array - Required:
true
- Type:
timeIncrementing animation time- Type:
number - Required:
false
- Type:
An example setup of an animation group with a couple of keyframes:
// Import eKeys library
const eKeys = footage('eKeys.jsx').sourceData;
// Create an array of keyframes
const inKeys = [
{
keyTime: 1,
keyValue: 0,
easeIn: 0,
easeOut: 66,
},
{
keyTime: 2,
keyValue: 250,
easeIn: 90,
easeOut: 0,
},
];
// Animate
eKeys.animate(inKeys);You can also destructure animate from the sourceData object:
const { animate } = footage('eKeys.jsx').sourceData;
// ...
animate(inKeys);-
Create default keyframe parameters
Use the JavaScript spread syntax to use a set of default parameters across keyframes.
View Code
const keyDefaults = { easeIn: 90, easeOut: 50, velocityIn: 10, velocityOut: 50, }; const keys = [ { keyTime: 0, keyValue: [0, 50], ...keyDefaults, }, { keyTime: 2, keyValue: [800, 50], ...keyDefaults, }, ];
-
Merge multiple keyframes groups
Easily merge multiple keyframe arrays to be animated using the JavaScript spread syntax.
View Code
const inKeys; const outKeys; const animOut = true; const keys = animOut ? [...inKeys] : [...inKeys, ...outKeys]; eKeys.animate(keys);
This could also be done by creating multiple
AnimGroup's. -
Remove specific keyframes
Remove one or more keyframes based on another variable.
View Code
const keys; const enableSpin = true; if (!enableSpin) { // Remove keyframes 4 and 5 keys.splice(3, 2); }
eKeys is built in such a way to make it easy for animators to use, based on the inputs and workflows they're used to when creating standard After Effects keyframes.
Outside of this context, eKeys might not make much sense or appear a little strange. It's not for everyone!
-
Add incoming and outgoing velocity inputs -
Updated curve sampling to Newton-Raphson -
Update to Javascript engine (from ExtendScript) -
Input validation and error checking - Add option to input easing as array, same as css cubic-bezier.
- Add animation method input (overshoot, bounce etc)
- Add ability to write in standard js and transform into After Effects jsx using babel
This project is licensed under the terms of the GNU GPLv3 license. In summary:
Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights.
The bezier function is from GaΓ«tan Renaudeau's cubic-bezier project, and is licensed under the terms of the MIT License.
Bugs, issues and feature requests can be submitted by filing an issue on Github. For everything else, feel free to reach out to @modeveloper on twitter.
