View all expressions
Motion

Automatic Scale Animation with Overshoot

Applies a smooth scale animation with an overshoot effect that dynamically adapts to the layer’s duration. The animation begins at the layer’s inPoint, peaks with an overshoot, and settles at the final scale. It then reverses the process at the outPoint, all without requiring any keyframes.

Contributed by:


scaleDuration = 0.5; // Animation duration - You may connect this to a slider
startValue = 0; // Start value
endValue = 100; // End value
overshootPower = 5; // Overshoot power in percentages
overshootValue = endValue * (1 + overshootPower / endValue);
if (time >= inPoint && time < inPoint + scaleDuration) {
t = (time - inPoint) / scaleDuration;
if (t <= 0.5) {
animatedValue = easeOut(t, 0, 0.5, startValue, overshootValue);}
else {
animatedValue = ease(t, 0.5, 1, overshootValue, endValue);}}
else if (time > outPoint - scaleDuration && time <= outPoint){
t = (time - (outPoint - scaleDuration)) / scaleDuration;
if (t <= 0.5) {
animatedValue = ease(t, 0, 0.5, endValue, overshootValue);}
else {
animatedValue = ease(t, 0.5, 1, overshootValue, startValue);}}
else if (time > outPoint) {
animatedValue = startValue;}
else {
animatedValue = endValue;}
[animatedValue, animatedValue];

Automatic Scale Animation with Overshoot

Practical use case

Perfect for animating elements like buttons, logos, or text, adding smooth and professional-looking scale transitions. Ideal for templates or projects where automatic, time-based scaling animations save time and effort.

Check out similar expressions

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

a mesh of elegant lines transparent image