ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Leave at last highest value of slider

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Alex Alvarez
Leave at last highest value of slider
on Jul 22, 2018 at 4:30:05 pm
Last Edited By Alex Alvarez on Jul 22, 2018 at 4:30:38 pm

Hi? everyone.
trying to figure out how to get this work
I have two sliders let say (Slider2) follow the (Slider1). If the value of (Slider1) decreases then (Slider2) should stop at the highest value until that moment and continue to grow after the value of (Slider1) goes higher than the last highest value

and same for (Slider3) and (Slider1) but below 0 when (Slider1) goes down (Slider3) follows it and when it turns around (Slider3) stays at the lowest point

(Slider1) is key framed


Return to posts index

Dan Ebberts
Re: Leave at last highest value of slider
on Jul 22, 2018 at 8:09:17 pm

It can be cpu-intensive because you have to check all the values at previous frames, so if your comp is long, it will probably bog down. This is how you could set it up for max value:


s = effect("Slider Control")("Slider");
t = inPoint + thisComp.frameDuration;
v = s.valueAtTime(inPoint);
while (t <= time){
v = Math.max(v,s.valueAtTime(t))
t += thisComp.frameDuration;
}
v


Dan



Return to posts index

Alex Alvarez
Re: Leave at last highest value of slider
on Jul 22, 2018 at 9:37:06 pm

Thank you a lot!!!!!!! I've been loosing my head for two days to figure it out. Dan, you are Genius! for minimum value I just changed Math.max to Mat.min works great


Return to posts index

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