Scale Down Bounce Expression

Community Beginner ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

I have a bounce expression that works when scaling up, but it doesn't work when I scale down. I need an expression that adds a bounce when scaling down. 

TOPICS
Expressions

Views

39

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

What's the scale up expression? It should help to define the kind of motion you're looking for on scale down.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

This is the expression I use. 

amp = .03;

freq = 3.0;

decay = 5.0;

n = 0;

time_max = 4;

if (numKeys > 0){

n = nearestKey(time).index;

if (key(n).time > time){

n--;

}}

if (n == 0){ t = 0;

}else{

t = time - key(n).time;

}

if (n > 0 && t < time_max){

v = velocityAtTime(key(n).time - thisComp.frameDuration/10);

value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

}else{value}

 

Numbers with Commas

var num = effect("Slider Control")("Slider")

num = Comma(num);

[num]

 

function Comma(number)

{

number = '' + Math.round(number);

if (number.length > 3)

{

var mod = number.length % 3;

var output = (mod > 0 ? (number.substring(0,mod)) : '');

for (i=0 ; i < Math.floor(number.length / 3); i++)

{

if ((mod == 0) && (i == 0))

output += number.substring(mod+ 3 * i, mod + 3 * i + 3);

else

output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);

}

return (output);

}

else return number;

}

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

It works for me, going in either direction (it even goes below zero if your last keyframe is close enough to zero). What's the particular issue you're seeing?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

How's it's working for you? I am trying to get the bounce to scale up before scaling down.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

LATEST

The expession you posted is for inertial overshoot--it keeps going in the direction it's moving, goes past the stopping point, and then settles out. It sounds like you may be talking about bounce rather than overshoot. I go over the difference here:

http://www.motionscript.com/articles/bounce-and-overshoot.html

Likes

Translate

Translate

Report

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

Make your promotional social content with Adobe Express.

Get started quickly with free templates: