ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Line height with slider control with 3 values

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Yorch Montoya
Line height with slider control with 3 values
on Aug 21, 2019 at 10:26:25 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]


Return to posts index

Andrei Popa
Re: Line height with slider control with 3 values
on Aug 23, 2019 at 2:22:06 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.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]