Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Exit

- Home
- After Effects
- Discussions
- Expression for Exponential Scale ?

- Expression for Exponential Scale ?

0

/t5/after-effects-discussions/expression-for-exponential-scale/td-p/13963041
Jul 25, 2023
Jul 25, 2023

Copy link to clipboard

Copied

Instead of using Keyframe assistaant > Exponential Scale, I would like to use an expression on the Scale property. What would be the correect expression taking into account scale at inpoint, scale at outpoint and duration between inpoint and outpoint? (my picture is zooming out)

Thanks !

TOPICS

Expressions

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

LEGEND
,
Jul 26, 2023
Jul 26, 2023

```
tStart=key(1).time;
tEnd=key(2).time;
tDiff=tEnd-tStart;
vStart=valueAtTime(tStart);
vEnd=valueAtTime(tEnd);
vDiff=vEnd-vStart;
mStart=Math.exp(0);
mEnd=Math.exp(1);
mFac=linear(time,tStart,tEnd,0,1);
mMul=Math.exp(mFac);
vStart+linear(mMul,mStart,mEnd,0,1)*vDiff;
```

Mylenium

7
Replies
7

/t5/after-effects-discussions/expression-for-exponential-scale/m-p/13963139#M233559
Jul 26, 2023
Jul 26, 2023

Copy link to clipboard

Copied

Something like this perhaps:

tStart=key(1).time;

tEnd=key(2).time;

tDiff=tEnd-tStart;

vStart=valueAtTime(tStart);

vEnd=valueAtTime(tEnd);

vDiff=vEnd-vStart;

vStart+Math.exp(tDiff)*vDiff;

Mylenium

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Crivello Laurent
AUTHOR

Community Beginner
,

/t5/after-effects-discussions/expression-for-exponential-scale/m-p/13963157#M233561
Jul 26, 2023
Jul 26, 2023

Copy link to clipboard

Copied

Community guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/after-effects-discussions/expression-for-exponential-scale/m-p/13964851#M233594
Jul 26, 2023
Jul 26, 2023

Copy link to clipboard

Copied

If you want the animation to start at the in point of the layer: * tStart = inPoint;*

If you want the animation to end 1 second before the out point of the layer: *tEnd = outPoint - 1;*

Check the expression I posted.

Community guidelines

Crivello Laurent
AUTHOR

Community Beginner
,

LATEST
/t5/after-effects-discussions/expression-for-exponential-scale/m-p/13964984#M233600
Jul 26, 2023
Jul 26, 2023

Copy link to clipboard

Copied

Thank you !

Community guidelines

/t5/after-effects-discussions/expression-for-exponential-scale/m-p/13963236#M233565
Jul 26, 2023
Jul 26, 2023

Copy link to clipboard

Copied

```
tStart=key(1).time;
tEnd=key(2).time;
tDiff=tEnd-tStart;
vStart=valueAtTime(tStart);
vEnd=valueAtTime(tEnd);
vDiff=vEnd-vStart;
mStart=Math.exp(0);
mEnd=Math.exp(1);
mFac=linear(time,tStart,tEnd,0,1);
mMul=Math.exp(mFac);
vStart+linear(mMul,mStart,mEnd,0,1)*vDiff;
```

Mylenium

Community guidelines

/t5/after-effects-discussions/expression-for-exponential-scale/m-p/13963881#M233578
Jul 26, 2023
Jul 26, 2023

Copy link to clipboard

Copied

Something like this maybe:

```
t1 = inPoint;
t2 = outPoint - thisComp.frameDuration;
v1 = valueAtTime(t1);
v2 = valueAtTime(t2);
if (time < t1){
v1;
}else if (time > t2){
v2;
}else{
d = t2 - t1;
dv = v2 - v1;
t = (time - t1)/d;
v1 + dv*Math.exp(10*(t-1));
}
```

Community guidelines

/t5/after-effects-discussions/expression-for-exponential-scale/m-p/13964314#M233589
Jul 26, 2023
Jul 26, 2023

Copy link to clipboard

Copied

If you want to work without keyframes, try this version of Mylenium's expression:

```
tStart=inPoint;
tEnd= inPoint + 2;// move time in seconds
tDiff=tEnd-tStart;
vStart=[10, 10];// starting Scale
vEnd=[70, 70];// ending Scale
vDiff=vEnd-vStart;
mStart=Math.exp(0);
mEnd=Math.exp(1);
mFac=linear(time,tStart,tEnd,0,1);
mMul=Math.exp(mFac);
vStart+linear(mMul,mStart,mEnd,0,1)*vDiff;
```

The math does not match applying the Keyframe Assistants' Exponential Scale perfectly, but it looks pretty good.

Change line two to *tEnd = outPoint,* and the animation will last as long as the layer.

Community guidelines

Resources

Troubleshooting FAQs

After Effects Community Recap

Getting started with After Effects

Copyright Â© 2023 Adobe. All rights reserved.