Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions animate scale from “0” tot “x”(slider control amount) with easy ease

  • animate scale from “0” tot “x”(slider control amount) with easy ease

    Posted by Bas V breugel on July 4, 2018 at 9:11 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.

    Scott Mcgee replied 7 years, 10 months ago 2 Members · 3 Replies
  • 3 Replies
  • Scott Mcgee

    July 4, 2018 at 9:48 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]);
    }

  • Bas V breugel

    July 4, 2018 at 12:16 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]);
    }

  • Scott Mcgee

    July 5, 2018 at 8:19 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.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy