Page 1 of 1

position interpolation in round numbers(no decimals)

Posted: May 7th, 2006, 11:47 am
by lichtrausch
hi all,

I am doing a lot of motiongrafix work for the motionpicture industry.
one task within every filmproject is the prduction of rolling endcredits.
here it is important to push the textlayer in round numbers
per second (no decimals) to avoid interlace problems by the time the sequence is put on film. I am trying to look for a scirpt that may make it easier to setup things.

normally I have two keyframes. the first starts the rolling credit plate to move up vertical. the second keyframe at the end of the (mostly predefined) time.
I was wondering if there is a script that tells the positionkeyframe to
interpolate in round numbers.

I am not experienced at all with scripting, I must admit.

anyway thanks for any kind of input in advance!

darius

darius@lichtrausch.com

Posted: May 7th, 2006, 8:11 pm
by bradshaw1965
Hi darius,

some useful javascript Object functions for what your trying to do:

from the Math object

Math.round(x)//returns rounded integer

Math.round(25.9) //returns 26
Math.round(25.2) //returns 25

Math.floor(a) // integer closest to and not greater than a
Math.floor(7/2) //returns 3

Math.ceil(a) // integer closest to a and not less than a
Math.ceil(12.01) //returns 13

This would probably work best as an expression that you applied to the keyframe in question, i.e. [Math.round(position[0]),Math.round(position[1])]
or
[Math.ceil(position[0]),Math.ceil(position[1])]

Do you have/need a more specific example?

Dale