Skip to content

🚜 Create layer attractors in After Effects using expressions

License

Notifications You must be signed in to change notification settings

volition74/eTractors

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

eTractors

System for creating particle effectors in After Effects using expressions

Usage | Example | Contact

Overview

eTractors is a way to create 'effector' layers that can attract and repel other layers when they move within a specified distance.

It comes in the form of a JSON file that's imported into the project, and then referenced in expressions.

Contents

Compatibility

This aeFunctions is compatible with After Effects versions >= 16.0.1 (CC2019) which use the new Javascript engine.

Back To Top ↑

Example

Example layer attraction setup using eTractors:

// Import the library
const eTractors = footage('eTractors.jsx').sourceData;

// Create a new effector
const myEffector = eTractors.createEffector(effectorLayer, particlePosition);

// Move towards the effector layer
particlePosition + myEffector.attract;

Usage

1. Download and import eTractors.jsx into your After Effects project

Download the eTractors.jsx file from the master branch of this repository, and import it into your After Effects project.

2. Add a reference to the library in your expression

aeEffector is designed to be used on the 2D position property of a layer, and this is assumed by all of the following expressions.

To reference the library in an expression, you need to assign it to a variable. This is done via the line:

const eTractors = footage('eTractors.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 the eTractors.jsx file 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.

3. Create a new effector

This creates a new effector based on an effector layer, and the position of the current layer.

const myEffector = eTractors.createEffector(effectorLayer, particlePosition);

The createEffector function returns an object with a couple of properties you can use to influence the motion of your particle layer.

4. Use effector properties

// Move towards attractor
particlePosition + myEffector.attract;

// Move away from attractor
particlePosition + myEffector.repel;

License

This project is licensed under the terms of the MIT License.

Back To Top ↑

Contact

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.

Back To Top ↑

About

🚜 Create layer attractors in After Effects using expressions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%