Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Creating an animated bar

  • Creating an animated bar

    Posted by Shane Brown on August 9, 2020 at 11:00 pm

    Hello,

    I’m fairly new to using expressions in After Effects. I’m looking to create a bar that scales only on the X-axis from left to right with a wiggle effect so that the scale will randomly bounce between 0 and 100 during the duration of the animation.

    Also would it be possible to have that same bar copied using a Repeater so that each copy made will be different?

    An example would look something like this:

    Tomas Bumbulevičius replied 5 years, 9 months ago 3 Members · 2 Replies
  • 2 Replies
  • Filip Vandueren

    August 10, 2020 at 9:44 am

    Create a rectangle that has as a width of what 50% would be.
    For example a rectangle of [180,30] (100 percenet would be 360×30)

    Give the Size of the rectangle this Expression:

    w=wiggle(1, value[0]);
    [w[0], value[1]];

    Give the Position of the rectangle this expression:

    value + [thisProperty.propertyGroup(1).size.value[0]/2, 0];

    Now you can’t use a repeater on that; they will all have the same Wiggle.

    Just duplicate the Rectangle Path (or The Rectangle Group) and reposition them.

  • Tomas Bumbulevičius

    August 12, 2020 at 9:55 am

    In addition to what Filip recommended, I would suggest the following:
    1. Keep every bar / shape layer, for easier contents access.
    2. In order to easily duplicate contents, set every following layer’s Y position to (index+1) + [some slider value], in order not to require repositioning them manually.

    ~ Thus, create a null layer in the comp, call it “controls”;
    ~ Apply Slider expression controller to a null, call it “yPadding”;
    ~ Duplicate original bar shape layer;
    ~ Apply expression to Y position (Separate dimensions)
    thisComp.layer(index+1).transform.yPosition + thisComp.layer("controls").effect("yPadding")(1)

    Duplicating top bar in the project panel’s list will move them down in Y automatically.

    Find out more:
    Motion Graphics Design & After Effects Tutorials
    On YT
    On VH

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