Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Modulos ? for DAN E

  • Modulos ? for DAN E

    Posted by Eric Sanderson on October 1, 2008 at 8:54 pm

    Hey, first off want to say thanks for making so much info on AE expressions available. Ive read through your whole site and really anything else i can get my hands on in the last few months. And think ive soaked up all i can from the internet, problem is with so much to learn and so few instances to apply it at my current AE mograph job its tough to stick. Thats why i came on here, trying to figure out other peoples probs to force me to learn and figure out stuff that i may not run into. Which brings me to my question regarding your last post on the opacity per frame solution. Im trying to break it down, I understand the “timeToFrames”, and i know that modulos returns remainders…but i dont understand it well enough to really know when or how to use it and that seemed like a good example…so by putting % after your timeToFrames, what exactly is happening? arent the frames whole numbers after converted? i know the +1 was cuz of his extra top layer so that just leaves the the frame%10 (which im guessing was how many layer he had, irrelevant to my question either way), so what is modulos doing with the frame number to the number 10 to get the result?

    Dan Ebberts replied 17 years, 7 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    October 1, 2008 at 9:08 pm

    You pretty much have it. With 9 layers, the modulo operation will give you 0,1,2,3,4,5,6,7,8,0,1,2,3,… The +1 just converts it to 1,2,3,4,5,6,7,8,9,1,2,3,4,…. so that it matches the layer indexes.

    Dan

  • Eric Sanderson

    October 1, 2008 at 9:19 pm

    oh i see, so to make sure…if i were to put it in a sentance would it sound like…

    “Out of the numbers being generated by the frames(0-90 in his example), only return the numbers equal to the number of layers in the comp(0-9).”.?

    So it doesnt matter if its whole numbers or not, modulos just takes from it what you tell it to?

  • Dan Ebberts

    October 1, 2008 at 9:33 pm

    Sort of. It just starts at one, increments the output at each frame, except that when it should go from 9 to 10, it resets back to 1 and starts again, repeating the 1-9 cycle over and over until the end of the comp.

    Dan

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