Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects HELP PLEASE…EXPRESSION TO LIMIT AN ANIMATION TO COMP DURATION!

  • HELP PLEASE…EXPRESSION TO LIMIT AN ANIMATION TO COMP DURATION!

    Posted by Muhammad Atif Bashir on February 3, 2021 at 8:50 pm

    Hello Everyone, I am recently working on a project and I need a help.

    so I have to create a project which my client can edit so it’s more like a template for him, it’s a music video but what he wants is that I should add a progress bar which should be dynamic.
    What I mean is that he doesn’t have to manipulate the keyframes, so I am looking for an expression which can calculate the comp duration (I know there is standard expression which can do this i.e. thiscomp.duration) but what I want the animation of my progress bar to be done automatically whenever the duration of comp is increased or decreased.

    I don’t I have explained well enough but if there is anyone who can help me, I will be very grateful to him/her.

    Kevin Camp replied 5 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kevin Camp

    February 4, 2021 at 3:29 am

    I’m not sure how you are animating the bar, but if you used a solid the size of the bar you need (maybe 1000 x 20) and moved the anchor point to the left edge of the solid, you could then animate the x-scale of the solid as the progress bar.

    The expression for the scale would be pretty simple:

    x = linear( time, 0, thisComp.duration, 0, 100 ) ;

    [ x, value[1] ]

    this should make the solid’s x-scale animate from 0% to 100% over the duration of the comp. However the solid would need to be as long or longer than the comp. If you were to make the comp longer than the solid, you would need to make sure you extend the end point of the solid to match the new comp length.

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