Activity › Forums › Adobe After Effects Expressions › Expression:%sign
-
Expression:%sign
Posted by Julian Sixx on June 10, 2006 at 8:45 amHi
What does the % sign mean/do when you use it with expressions?
ThxJulian Sixx replied 19 years, 11 months ago 2 Members · 2 Replies -
2 Replies
-
Mylenium
June 10, 2006 at 11:13 amThis is the modulus. The scientific definition is that it will return the remainder of a division. So if you divide 6/2=3, it will return 0, if you divide 5/2 it will return 0.5. This can be used to trigger events in a cycle, define if a number is odd or even and a few other things. So if you for instance have a formula like:
x=timeToFrames(time)%70
Your object would increase its position from 0 to 70 until it reaches frame 70. At this point position and frame value are identical and the formula will return 0, thus resetting it. From fram 71 to frame 140 the cycle will then repeat and so on.
Mylenium
[Pour Myl
-
Julian Sixx
June 10, 2006 at 11:49 amHi
Thanks Mylenium!
That’s a very good example to explain it.:)
Reply to this Discussion! Login or Sign Up