Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to loop a multiple numbers

  • How to loop a multiple numbers

    Posted by Doni Donovan on October 9, 2015 at 4:31 am

    Hello sir could u help me in this case?
    for example i have a slider, the value is 0. if i change value > 100 it should go back to 0. if value > 200 it go back to 0. if value > 300 it go back to 0, etc

    sorry i just learn english

    I only can make expression in once condition

    (effect("Slider Control")("Slider") > 100) ? effect("Slider Control")("Slider") - 100 : (effect("Slider Control")("Slider")

    Doni Donovan replied 10 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 9, 2015 at 5:11 am

    I can’t tell if this is what you’re after:

    effect(“Slider Control”)(“Slider”)%100

    or if it’s more complicated than that.

    Dan

  • Doni Donovan

    October 9, 2015 at 7:16 am

    Dont worry Dan finally i can found the formula 😀
    i spent 5 hour for create this expression and it make me (designer) crazy xD
    so now i can slide like i want for get unlimited hue

    Thanks Dan

    inRGB =content("Group 1").content("Fill 1").color;
    inHSL = rgbToHsl(inRGB);
    a = effect("Slider Control")("Slider");
    b= (a < 0) ? Math.abs(a+200): a; c = b%200; newHue = inHSL[0] +(c*0.005); newHSL = [newHue, inHSL[1], inHSL[2], inHSL[3]]; hslToRgb(newHSL);

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