><

Averaging one layer between two others



This expression positions and maintains one layer at a balanced distance between two other layers. To achieve this effect, you need three layers in your composition.

To average one layer between two others:

1 Start with three layers.

2 Create motion paths for the first two layers in the Timeline.

3 Select the Position property for the third layer and choose Animation > Add Expression.

4 Select the default expression text and type the following:

mul(.5, add(this_comp.layer(1).position, this_comp.layer(2).position))

5 Click outside the expression to activate it.


Creating Expressions > Sample expressions > Averaging one layer between two others