position interpolation in round numbers(no decimals)

What type of scripts do you need?

Moderator: byronnash

Post Reply
lichtrausch
Posts: 1
Joined: May 7th, 2006, 3:46 am
Location: berlin, germany
Contact:

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
bradshaw1965
Posts: 98
Joined: March 14th, 2006, 2:16 pm
Location: Atlanta, GA
Contact:

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
Dale Bradshaw
Technology Director | Primal Screen
creative-workflow-hacks.com
Atlanta, GA
Post Reply