Trajectory



Version: 2.51 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 control these parameters from each layer insted of the control layer.
Compress Expand

The compress expand slider allows you to dynamically lengthen or shorten the length of your trajectory. A positive number will lengthen your line, a negative number will shorten it. a value of zero will give you a normal trajectory where the first layer will have the same position as the startPosition null and your last layer will have the same position as the endPosition null.
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.51 Added new slider on the control null that allows you to lengthen and shorten (compress-expand) the length of the line. Thanks to Dan Ebberts for help with the code – 10/2010
- 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
The definitive collection of scripts and plugins for Adobe After Effects









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
Danny,
You shouldn’t have to parent them, just select both nulls at the same time and move them.
the ring at the top was made using techniques from this tutorial
http://library.creativecow.net/articles/dewaele_tielman/simple_ring.php
Mike Cardeiro
awesome tuts thanks!
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
Hello Michael,
Would you share the changes with me? I’d love to contribute by translating the script to German.
Best, Jake
This is a very useful script!
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.
Hello Mike,
here in Paris, I’m testing your trajectory script
but the controler doesn’t work
an other question is about..
when I put some 3D path to the final null,
the layer are far from the first null, the departure null
… is ther a way to control this anchor point if we want the first layer to be close or far of the anchor point of this null.
All the best from this side of the screen
Blick
Thanks a lot its awesome!
Hi Oh really annoying I’m from Iran and I ask if I possibly Affkts education pdf After the training email me thanks M……