Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Get the completion of a slider

  • Get the completion of a slider

    Posted by Marjon Le roy on April 20, 2020 at 9:34 am

    Hi,

    I have been checking the forum for years and learned a lot! So thanks to everyone!

    So my situation:
    I have a slider with the value ranging from 70 to 100. Now I want to know the position on the slider so I can use it in my expressions. So I want the starting value (70) to be 0% and the end position (100) 100%;
    But I can’t figure it out. Does anybody have an idea how to solve this?

    Thanks in advance!

    Marjon Le roy replied 6 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    April 20, 2020 at 2:46 pm

    Maybe something like this:

    s = thisComp.layer(“Control”).effect(“Slider Control”)(“Slider”);
    pct = linear(s,70,100,0,100) + “%”;

    Dan

  • Marjon Le roy

    April 20, 2020 at 3:16 pm

    Thanks for the help Dan!
    I dove into some math last couple of hours and just figured it out myself. And it is actually quit easy.

    For those who want to know how I solved it, this is the formula:
    ((slider value – start value)/(end value – start value))*100

    So my expression looks like this:

    slider = thisComp.layer("Control").effect("Slider Control")("Slider");
    p = ((slider - 70)/(100-70))*100;

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