Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Change scale of shape after 1 second using expressions and slider control

  • Change scale of shape after 1 second using expressions and slider control

    Posted by David Gabriel on October 22, 2016 at 1:01 am

    Hi there,

    I haven’t used expressions before and don’t know what I am doing!
    I want to create four animated rectangles to be a bar graph of four survey responses (in percentages).
    I want to use four slider controls so that another person can select the four different bar graph values when I am not around.

    I want the bar graphs to do the following:

    Start animating after 1 second.
    Change scale from 0% to the value of the slider control.
    I want the animation (scale from 0% to value) to happen over two seconds.

    I can’t do one, let alone all four of them.

    Can somebody help me please!

    Thanks.

    Walter Soyka replied 9 years, 6 months ago 3 Members · 4 Replies
  • 4 Replies
  • Greg Gesch

    October 22, 2016 at 2:33 am

    Hi David, a simple way to do it with basic rectangles would be:
    Make a shape layer by drawing a straight line with the pen tool from bottom to top, the length of the 100% bar. Make the stroke the color and width you want it to be (you will now have one rectangle/bar)
    Toggle open the shape layer and in Contents highlight Shape1. Add (use the add button next to Contents) Trim Paths.
    Duplicate Shape 1 three times
    Select each numbered shape and using its Transform property position the bars where you want them (in order ie Shape 1 first, Shape 2 second etc).
    With the Shape Layer selected add 4 Slider Controls
    Toggle open all the sliders
    Toggle open Shape 1 and, in its Trim Paths, ALT click the End setting and pickwhip it to Slider 1
    The same with each shape to its own Slider.
    At the 1 second mark keyframe each slider to 0, at 3 seconds add keyframes for 100.

    Now in your Effects Control Panel you will see the 4 Slider controls. THE TIMELINE MUST BE AT EXACTLY 3 SECONDS (SITTING EXACTLY OVER THE KEYFRAMES). You can now set each slider to the final %. and the bars will go from 0% to whatever is set for each bar.

    If not exactly what you are after it may give you a starting point?

  • David Gabriel

    October 22, 2016 at 2:53 am

    That’s great thanks for that. Nice idea doing the bars with the thick stroke as well. I was using rectangles.

    Do you know if there is a way to change the slider control with outhaving to be on the actual keyframe? I am trying to make this like a template that anybody can use when I am not there.
    Maybe there is possibly a way to link that last keyframe to an expression that you can set the value to?

    I am also wanting to automate a counting number next to the bar (using the number value from the slider control) to show the total %. But that is a whole other issue!

  • Greg Gesch

    October 22, 2016 at 3:35 am

    Hi. Sorry, I’m afraid that’s getting out of my knowledge zone – though instinctively I feel the expression experts here can no doubt simplify and be able to help with the other issues. Good luck with it, I’m sure someone will chime in with clever ideas.

  • Walter Soyka

    October 23, 2016 at 8:34 am

    [David Gabriel] “Start animating after 1 second.
    Change scale from 0% to the value of the slider control.
    I want the animation (scale from 0% to value) to happen over two seconds.”

    You could use an interpolation function to go from 0 to the value of the slider as time goes from one second after the layer’s in point to three seconds after its in point:

    linear(time, inPoint+1, inPoint+3, 0, effect("Slider Control")("Slider"))

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

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