Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Control time of composition with slider control (in seconds)

  • Control time of composition with slider control (in seconds)

    Posted by Saso Goricar on October 16, 2018 at 6:58 pm

    Hello,

    I have one question about the problem. I’m creating a .mogrt file and I want to add a slider control to control the duration of the animation (composition). Is there an expression to fix that, that I can change the duration of composition (duration in seconds) with just a slider control.

    Thanks for the help.

    Saso

    Duane Walters replied 5 years, 2 months ago 3 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    October 16, 2018 at 7:26 pm

    You can’t control duration with an expression, but you could drop your comp into another comp, turn on time remapping, and use a time remapping expression like this:

    s = thisComp.layer(“Controls”).effect(“Slider Control”)(“Slider”);
    linear(time,0,s,0,key(2).time)

    Dan

  • Saso Goricar

    October 16, 2018 at 8:04 pm

    Thanks, that is exactly what I was looking for. Thank you very much, you are a lifesaver.

    Do you know if this expression works in new version AE cc 2019 with the new feature “Create protected region”?

    Thanks again.

    Saso

  • Dan Ebberts

    October 16, 2018 at 8:35 pm

    I haven’t played with that feature yet. Try it. ☺

    Dan

  • Saso Goricar

    October 17, 2018 at 7:57 am

    I will, thanks for your help.

    Saso

  • Duane Walters

    February 10, 2021 at 8:59 pm

    In 2021… it does work, but it doesn’t actually honor the protected regions, is there a way to do that?

  • Duane Walters

    February 11, 2021 at 4:52 pm

    Never mind, I have re-evaluated my needs to just use protected regions 🙂

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