ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Creating 4 dynamic percentage bars to make a fixed width

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mark CheltenhamCreating 4 dynamic percentage bars to make a fixed width
by on Feb 4, 2014 at 12:09:54 pm

Hi all, I think expressions is going to be the answer to this but, being a newbee to expressions I'm struggling with this.

I have a horizontal bar 1920 pixels wide. It is made up of 4 adjoining smaller bars - all of which will be animated percentages and all 4 must total 100% at all times, for example at frame 10 it could be
bar 1; 30%
bar 2: 25%
bar 3: 15%
bar 4: 40%

the values are changing very quickly so animating manually is not a good idea.

I can get each bar reacting to an expression slider but can't automate the x position point of other bars for example, bar 2 x position starting wherever bar 1 ends depending on bar 1 % value, and bar 3 x position dependent on wherever bar 2 ends depending on bar 2 % value etc

Any thoughts from expression masters would be most welcome

thanks

mark


Return to posts index

Walter SoykaRe: Creating 4 dynamic percentage bars to make a fixed width
by on Feb 4, 2014 at 6:18:10 pm

If the bars are all fully opaque, there's no need to worry about trimming them; you can simply stack them on top of each other and treat them cumulatively.

(In your example, bar 1 would be 30%, bar 2 would be 55%, bar 3 would be 70%, and bar 4 would be 110%. You have a math error in there...)

If this doesn't work for you, I can think of a couple different ways to approach it, depending on what you want the appearance to be. Can you describe the visual or post a screenshot?

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Mark CheltenhamRe: Creating 4 dynamic percentage bars to make a fixed width
by on Feb 5, 2014 at 8:05:50 am

Hi Walter, thanks for the reply and offer of further help.

I figured it out yesterday by parenting the next bar to a null that was on the end of the previous bar. I took the percentage of the first bar and by multiplying it by 19.2 (the width of the 100% bar was 1920 pixels) got the position for the null on the end. All the bars were parented and stacked up in this manner and seems to work ok.

regards

Mark


Return to posts index

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