Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions increment up and then back down with modulus.

  • increment up and then back down with modulus.

    Posted by Nathan Apffel on January 29, 2018 at 4:43 pm

    I am incrementing a new value for each layer with index. like this:
    ((index-1)*3)%30
    This expression counts by 3 for 9 layers and then starts over at 0 for the 10th layer.
    Is there an expression that will count up and then back down. resulting in something like:
    0 ,3,6,9,12,9,6,3,0

    Thanks

    Nathan Apffel replied 8 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 29, 2018 at 6:21 pm

    Like this maybe:

    idx = (index-1)%8;
    if (idx <= 4) idx*3 else (8-idx)*3

    Dan

  • Nathan Apffel

    February 3, 2018 at 4:12 pm

    Thanks for the reply. However that did not do the trick. I think the Math.sin function might be the answer but i haven’t gotten that to work yet.

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