ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

increment up and then back down with modulus.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nathan Apffel
increment up and then back down with modulus.
on Jan 29, 2018 at 4:43:12 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


Return to posts index

Dan Ebberts
Re: increment up and then back down with modulus.
on Jan 29, 2018 at 6:21:25 pm

Like this maybe:

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


Dan



Return to posts index

Nathan Apffel
Re: increment up and then back down with modulus.
on Feb 3, 2018 at 4:12:36 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.


Return to posts index

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