In this section, you will dive deep into the world of 3D projects in After Effects. You will learn how to efficiently find the center of many null objects and create a jump vector that can be used for animating jumps on a spherical surface. We will use specific expressions that automate the entire process, allowing you to save the tedious manual work.
Key Takeaways
- You will learn how to calculate the center of multiple layers with an expression.
- You will find out how the jump vector ensures that the jumps are perpendicular to the spherical surface.
- The use of expressions greatly simplifies the animation process.
Step-by-Step Guide
Finding the Center
To calculate the center, you start with the basic formula, which is the sum of the positions of all layers divided by the number of layers. It is important to clarify how many layers you actually have, as this is essential for calculating the average.
First, you insert an expression into the position of your null object. Hold down the Alt key and click on the stopwatch icon next to "Position" in the timeline.

Next, use the following variables to determine the index of the first and last layer. Define "IDX_A" for the first layer and "IDX_B" for the last layer, which allows you to calculate the total number of layers (Num_L) by simply using IDX_B - IDX_A.
Now it's time to create a loop that iterates through all the layers. You achieve this with a for loop that sums the position of each null object.
Within the loop, you access the current position of the layer and add it to the variable "Avg_POS," which stores the average. Make sure to handle the X, Y, and Z values correctly.

After all positions have been summed, divide the total position by the number of layers to get the actual average value. Here it will be necessary to also consider the dimensions (X, Y, Z).
In the end, you will get the center of all layers in your composition, and all of this happens dynamically without having to manually count the layers.
Creating the Jump Vector
With the knowledge of the center, we now turn to the jump vector. The jump vector allows you to create beautiful arcs perpendicular to the spherical surface without any manual animation being necessary.
Again, you start with an expression on the layer that represents the jump vector. Hold down the Alt key and click on the stopwatch icon again. You will need your starting points here.

The first point will be the current position of the object, while the second point is the center (World Center). Now it is necessary to calculate the vector position. The jump vector is derived from the difference between the position of the point and the center.

Here, "PointPosition" is the position of your object in the world and "WorldPosition" is the center.
To make the vector dynamic and movable, you can also create variables for the X, Y, and Z values of your vector. Simply insert the corresponding value from your vector into the expression.

Now you can control the animation of your objects easily and achieve the desired result.
Conclusion
The implementation of these two expressions allows you to work efficiently with After Effects and create complex animations that are precise and time-saving. With this step-by-step guide, you have learned the basics of working with 3D projects in After Effects and are ready to implement your creative ideas.
Summary – Finding the Center and Jump Vector in After Effects
In this guide, you learned how to calculate the center of null objects using a simple expression. Additionally, you got to know the process of creating a jump vector through a mathematical consideration of the vectors within 3D space.
Frequently Asked Questions
How do I calculate the center of multiple null objects?You can calculate the center by summing the positions of all null objects and dividing by the number of objects.
What is a jump vector?The jump vector is a mathematical vector that indicates the distance between an object and a center point and is used for animations.
How helpful are expressions in After Effects?Expressions automate many processes and allow for complex animations without manual intervention, saving time and effort.