Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Line height with slider control with 3 values

  • Line height with slider control with 3 values

    Posted by Jorge Montoya on August 21, 2019 at 10:26 am

    Hi all.
    I´ve seen something similar to this but didn´t found a way to use it on my project.
    I have a red line with a fixed width, and i want to control it´s height with a slider control with just 3 values.
    I´m trying to do this with the scale, so the larger size would be 100% (value 3) the middle size would be 65% (value 2) and the lower size would ve 30 (value 1)
    And for the moment i can set the slider values by setting 30 as the first value and 100 as the third value, but i want to jump from value 1 to value 2 to value 3 without sliding between all the percentage.
    The expression i´m using for the height control is this in the scale property in the shape layer:

    Is a simple one and is functional, but i´m not able to limit the slider control to just the 3 values i want, is there any way to do that?

    Thank u

    h= thisComp.layer("Nulo 2").effect("Slider")("Deslizador");
    [value[1],h]

    Andrei Popa replied 7 years ago 2 Members · 1 Reply
  • 1 Reply
  • Andrei Popa

    August 23, 2019 at 2:22 pm

    Maybe put this expression and set the values for the slider from 1 to 3.

    myValues = [30,65,100];
    h=Math.floor( thisComp.layer(“Nulo 2”).effect(“Slider”)(“Deslizador”));
    [value[1],myValues[h]]

    Andrei
    My Envato portfolio.

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