Watch a quick demo video about this script

Align all layers in a composition evenly on a line between 2 nulls with delay controls for animation.

"Name Your Own Price"
You can pay anything you want, the amount displayed in the cart is only a suggested amount.
View Cart

Trajectory This is a new version of this script Compatible with After Effects CS3Compatible with After Effects CS4Compatible with After Effects CS5

Version: 2.01   Sign up to be notified by email when a new version of this script is posted

The trajectory script will take all layers in a composition and plot them evenly on a line between 2 nulls.

Getting Started

Install the script in the scripts folder.  To run the script, simply select the layers you would like to be linked in the trajectory and select the script from the File->Scripts menu.  When the script is run, it will take all layers in the selected composition and make them 3d. It then creates 3 nulls, 2 of these nulls are used to create the trajectory along which all layers lie and the third null is a control layer which will be discussed in a moment.  The 3 nulls must be the last 3 layers in the comp, and the control layer must be the last layer in the comp.

You can move the 2 nulls named “startPosition” and “endPosition” and all the layers in your comp will disperse evenly on a line between the 2 nulls.

Add keyframes to the nulls position and the layers will follow.

Control Layer

The “controlLayer” null controls the rotation and opacity of the layers. The “Transform Delay” slider allows you to offset each layers reaction to changes in the control layer…so if you have xRotation on the controlLayer keyframed from frame 1 to 10 and offset set to 5, layer 1 will do the xRotation from frame 1 to 10; layer 2 will transform from 6 to 15; and layer 3 will transform from frame 11 to 20.

The reverse delay checkbox will cause the delay to go from last layer to first layer instead of first to last.

Check the “Disable Control” checkbox if you would like to individually controll these parameters from each layer insted of the control layer

Adding Layers to your Trajectory

If you want to add a layer from your project to a trajectory comp, simply duplicate any layer in the comp that is not a null, select the dup, and alt+drag the item and drop it on the selected layer and it will become part of the trajectory.

Using Trajectory Comp in another Comp

If you put your trajectory comp inside your main comp and enable “collapse transformations” for that layer, your trajectory comp will become part of the scene and react to cameras.

Version History

  • 2.01 Blessed for CS5 and updated to run in any language not just english. Thanks to: François Cora for the French translation and Jakob Behrends for the German translation – 06/2010
  • 2.0 Initial release on aescripts.com – 01/2010

Last updated June 29th, 2010
9,378 views
Tags: , , , , , , ,

About the author

Mike Cardeiro has been creating graphics with after effects since 1997. He has been programming computers since the early 80's and when Adobe introduced scripting into the mix he jumped in. Mike is currently employed at an ad agency in Philadelphia as an animator/designer. View Resume

Pingbacks

16 Comments

  • Argh… Trajectory moves all my layers and centers them on their anchor point.

    How about an option to keep my layers’ 2D position where they are? (For example, a Photoshop/Illustrator comp imported as Footage Dimensions>Layer Size (not document size))

    • Hey Navarro,

      Not exactly sure what you want it to do, the script puts an expression on the layers position…you can move the layers anchor point to change how it lays on the line; but the whole point of the script is to arrange the layers along a 3d line.

      if you can explain better or send me a pic of what you are trying to do (mcardeiro@yahoo.com), maybe I can modify the script for you.

      Mike Cardeiro

  • Hi Mike, just downloaded your script … need to know if your demo video has done whole with your script… i would like to re-build that animation with my stuff (hundreds of pics and less videos)…
    If i well understood the goal is to move around the 2 null as starting and ending point and setting other parameters with the third one… ok?! but… instead of a straight line it is possible use an Illustrator path as trajectory?

    Thx, Andrea.

    • Hey Andrea,

      in the demo, the array of videos on the left and right side of the talent was done with the script. the video ring up above was not.

      it only works with a straight line that is formed between the 2 nulls.

      Mike Cardeiro

  • Hi,
    I would like to apply the “atmosphere plugin – By Digieffects”, it affects the z value of each layer but did not works in conjunction with the script.

    have you got any suggestion?

    thanks in advance

  • Does it work if you precomp the trajectory layer and apply the plugin to the precomp?

    Mike Cardeiro

    • yes i try but the plugins affect the z value and must be applied on each one.

      ok it works normally with the layers but the control layer (the plugin adds it) is considered as the last of the whole trajectory, the same happens if I add a camera layer.

      no problem, just few adjustments and it’s ok.

      thank you

  • Hi Mike,

    Thanks for your script. Two questions I was hoping you can help me with:

    - Is there any way to move both start / end null together? (i.e. without having to animate both null layers separately?) I tried parenting one to another but it totally messed up the effect?

    - Is there any script to align layers in a 3D circle (like the one in your demo video)?

    Thanks for all your help

  • Hello,
    Thanks you for the script. Just a little problem, it doesn’t work on my AE version (cs4), probably cause i ve got a french version..
    First there is an error “classe ‘effect’ no have property or methode name “checkbox” and second “impossible to execute script line 136…checkbox too.
    Do you think its possible to change some line of the script to make it run.
    (my english is deplorable, sorry)

    • There was a problem in the way after effects refers to a checkbox in french. I worked with Fran to get the script running in his French version of AE. I will put the fix in the downloadable script soon.

      this only effects people running the script in languages other than English. If you have a problem running the script in a language other than English let me know and I’ll see if I can get it working for you (and worked into the code).

      Mike Cardeiro

  • Hey Michael I download your Scrip and works great.I dint have any money at this time but i will make it up soon.. I just want to thank you for your great work..I need some more of the scrips but I fell bad just to take them for free..tank you again.and keep the good work.

Leave a comment

(to reply to a specific comment use the link by the comment)