Exponential Scale

Turn linear scale keyframes into smooth exponential growth using a simple expression.

Author:
Gimmel
Source:
https://aenhancers.com/viewtopic.php?t=392
Category:
Animation

Expression Code

s = Math.exp(transform.scale[0] / 21.667905) - 1;
[s, s]; // apply the same result to both X and Y scale
jsx
// s = the exponential version of the scale
// 21.667905 is a pre-calculated constant that maps 0–100% to 0–100% output range
// This way:
// - 0% keyframe becomes 0% actual scale
// - 100% keyframe becomes 100% actual scale
// - 50% becomes ~9% actual scale (because of the exponential curve)

// The final line outputs [s, s] to keep the scaling uniform
js

Where to Apply

Apply this expression to the Scale property of your layer.
It works great on shapes, text, precomps, or anything with scale values.
Make sure “Constrain Proportions” is on, or it’ll only affect X scale.


How It Works

Here’s what’s cool about this one:
You still use keyframes normally (just like you always would), set values, add easing, even use hold keyframes. But instead of getting a boring linear scale, this expression tweaks the output to behave exponentially.

Why does that matter?

Because visually, a change from 1% to 2% is a big jump (you’re doubling the size), while 99% to 100% barely changes anything. This expression fixes that imbalance and makes growth or shrinking feel smoother and more realistic.

Here’s the trick behind it:

  • It takes your scale keyframe value (usually 0 to 100),

  • Feeds it into the exponential function (Math.exp()),

  • And then shifts the result so that 100% stays 100%, and everything else grows in a curved, more natural-feeling way.

That constant 21.667905 was carefully chosen so that the math lines up nicely between 0% and 100%.

So if you’ve ever found your scale animation feels too stiff or flat (even with easing), this one’s a great go-to. It works especially well when animating things that need to grow smoothly, like UI elements, infographics, or abstract motion.

Frequently asked questions

How do I use the expression on this page?

Just copy the full expression code from the top of this page. Then Alt-click (or Option-click on Mac) the stopwatch on the property you want to animate. Paste the code into the editor and that's it. If you’re not sure which property to use, check the "Where to Apply" section above.

The expression isn’t working. What should I check?

First, make sure your project is using the JavaScript engine (go to File > Project Settings > Expressions). Also double-check for missing characters, and see if the code requires parenting a layer. If so, there will be a comment in the code explaining what needs to be connected.

I’m not sure what the expression does. Where can I learn more?

Take a look at the "How It Works" section on this page. It explains each part of the expression in plain language so you can understand how everything works together.

Can I customize how the expression behaves?

Yes, absolutely. Most expressions include easy-to-edit variables near the top and comments that guide you on what to change. You can also link sliders or checkboxes using Expression Controls if you want more control in the timeline.

Can I apply this to other properties too?

Yes, you can use it on any property with a stopwatch. That includes Position, Scale, Opacity, and also effect settings like Blur or Tint.

Will it work in comps with different frame rates or sizes?

In most cases, yes. These expressions are designed to adapt to your comp’s resolution and frame rate. If anything specific needs adjusting, it’ll be noted in the code or in the "How It Works" section.