ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

animate scale from "0" tot "x"(slider control amount) with easy ease

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Bas v Breugel
animate scale from "0" tot "x"(slider control amount) with easy ease
on Jul 4, 2018 at 9:11:57 am

Hi guys,

Im trying to making a bar graph animate from 0 to an amount referrenced from another layer.

So I have a text layer called "Shot_Percentage" wich has the amount "33.3"

Then I want to scale a shapelayer from "0" to "33,3" and make it ease out at the end.


Return to posts index

Scott McGee
Re: animate scale from "0" tot "x"(slider control amount) with easy ease
on Jul 4, 2018 at 9:48:37 am

As long as your shape to start is 100% and 100% of the bar graph. Then you just need to copy and paste this into your scale of the transform properties.

Then yb = pickwhip your slider control.

transition = 1
ya = 0;
yb = effect("Slider Control")("Slider");
x = 100;

if(time < (inPoint+outPoint)/2){
ease(time,inPoint,inPoint+transition,[x,ya],[x,yb]);
}else{
ease(time,outPoint -transition,outPoint,[x,yb],[x,ya]);
}


Return to posts index

Bas v Breugel
Re: animate scale from "0" tot "x"(slider control amount) with easy ease
on Jul 4, 2018 at 12:16:05 pm

Thanks! I adjusted your expression slightly because i forgot to mention I've made a horizontal bar graph. And now the amount it grows to is not from a slider but straight from complayer.

transition = 1
xa = 0;
xb = parseInt(thisComp.layer("Shot_Percentage").text.sourceText);
y = 100;

if(time &lt; (inPoint+outPoint)/1){
ease(time,inPoint,inPoint+transition,[xa,y],[xb,y]);
}else{
ease(time,outPoint -transition,outPoint,[xb,y],[xa,y]);
}


Return to posts index


Scott McGee
Re: animate scale from "0" tot "x"(slider control amount) with easy ease
on Jul 5, 2018 at 8:19:22 am

Sorry I missed the bit about you using sourceText.

If it's for someone else to use that isn't after effects savvy. I sometimes put in an alert feature that tells them it isn't a number.

for sourceText layer
a = thisLayer.text.sourceText
if(isNaN(a)){
"THIS IS NOT A NUMBER"
}else{
text.sourceText;
}


also if the text layer is to be hidden. I also add this to it to the opacity.

a = thisLayer.text.sourceText
if(isNaN(a)){
100
}else{
0
}


It's nothing flashy, but for someone who doesn't know how to use it and wonder why it isn't working, does come in handy.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]