View all expressions
Interpolation

Scale Based On Distance

Calculates the distance between two layers and then affects a property based on it.

Contributed by:


targetLayer = thisComp.layer("TargetLayer");
dist = length(thisLayer.position, targetLayer.position);
value * (1 + dist / 500);

Scale Based On Distance

Practical use case

Scaling an object based on its distance from another object in the scene.

Check out similar expressions

Data-driven video workflows for After Effects are easier with Plainly.

a mesh of elegant lines transparent image