Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expression for scaling bar several times

  • Expression for scaling bar several times

    Posted by Ed Home on December 13, 2013 at 8:32 pm

    Hi there,

    I hope somebody can help me, because I’m a newby…
    I made a rectangle (bar) which has to increase and decrease several times, during 15 seconds.
    Must look like it’s fluctuating. I can do that by use keyframes, but because there are 15 bars fluctuating at the same time it’s a lot of work (intention is to create a chart with fluctuating bars).
    Does somebody know if there is an expression which I can use?

    Edith

    Roland R. kahlenberg replied 12 years, 4 months ago 2 Members · 3 Replies
  • 3 Replies
  • Roland R. kahlenberg

    December 15, 2013 at 9:25 am

    Ensure that you first move the Anchor Point to the bottom edge of your bar. This ensures that scaling is anchored at the bottom of the bar.

    Use the following script in a single layer’s position –

    bar_width = 120;
    xScalar = (index-1)*bar_width;
    x_Startvalue = 100;
    y_value = 640; //floor value for the bars

    [x_Startvalue+xScalar,y_value]

    ————

    Use this script for its scale prop

    Scalar = transform.scale;
    frequency = 2;
    amp = 50;

    [100,Scalar.wiggle(frequency,amp)[1]]

    ——————-

    Then simply duplicate the layer as many times as you need bars. Changing the variables (the numbers after the = sign in the scripts should be easy enough for you to customize the script).

    HTH
    RoRK

    Intensive mocha & AE Training in Singapore and Other Dangerous Locations

    Imagineer Systems (mocha) Certified Instructor
    & Adobe After Effects CS6 ACE/ACI

  • Ed Home

    December 15, 2013 at 6:29 pm

    Sorry, one final question… The expression I paste works only in the height of the bar. But my bar only has to fluctuate on the length (it’s a bar which is laying). So instead of the heigt it must be in the length. I tried to change code of the expression, but my knowlegde of expressions is not to good. Hope you cab help me again 🙂

    Edith

  • Roland R. kahlenberg

    December 15, 2013 at 11:45 pm

    Parent the bar layers to a Null Object. Then use the Null’s Rotation and Position to orientate and position the bars to suit your needs.

    HTH
    RoRK

    Intensive mocha & AE Training in Singapore and Other Dangerous Locations

    Imagineer Systems (mocha) Certified Instructor
    & Adobe After Effects CS6 ACE/ACI

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