Page 1 of 2

Random tidbit for those animating in MAX

Posted: Tue May 01, 2012 3:00 am
by Nielk1
If you are making an animation in 3dsMAX you are using keyframes. The program interpolates between keyframes. The problem is that BZ2 interpolates differently than MAX does, so your animations might not look how you expect.

The interpolation can be described by these two equations:
MAX: Y = (cuberoot((X/(T/2))-1)*((B-A)/2))+((B-A)/2)+A
Game: Y = (X*(B-A)/T)+A

Where A is the value of the first keyframe, and B is the value of the second, Y is the resultant value, T is the time between frames. X is the time after the first frame and Y is the resulting value of what you are interpolating.

You could probably tweak it a bit more replacing T with (SecondFrameTime - FirstFrameTime) and making X take in the global time instead of the local (right now its time since first frame). If you do would you please post it.

Long story short, plug both these into a graphic calculator and you can see the difference between how BZ2 and MAX interpolates. It matters.

Re: Random tidbit for those animating in MAX

Posted: Tue May 01, 2012 4:42 am
by bigbadbogie
That simple is it?

Re: Random tidbit for those animating in MAX

Posted: Tue May 01, 2012 4:54 am
by MrTwosheds
Not quite sure I got it either.

Re: Random tidbit for those animating in MAX

Posted: Tue May 01, 2012 6:32 am
by Nielk1
I had the equations switched there.

Yea, that simple...

To understand it better...
Game is y=x
Max is y=cuberoot(x)

Not counting all the extra bits.

Re: Random tidbit for those animating in MAX

Posted: Tue May 01, 2012 5:08 pm
by Zax
Not to mention you can go in and change the actual interpolation in max through the curves. Only do this if you are making a movie, though, because you will shoot yourself unless 3DS is your occupation.

Re: Random tidbit for those animating in MAX

Posted: Tue May 01, 2012 5:54 pm
by Apollo
If you don't use autokey and set the keys manually, the interpolation should be ok in bz2.

Re: Random tidbit for those animating in MAX

Posted: Tue May 01, 2012 7:02 pm
by Nielk1
Apollo wrote:If you don't use autokey and set the keys manually, the interpolation should be ok in bz2.
Incorrect. This is only true if you set a keyframe on every frame, which makes it hard to maintain and edit.

Yes you can set max to linear, but its not a global setting, you have to do it per individual key frame pair.

Re: Random tidbit for those animating in MAX

Posted: Tue May 01, 2012 7:19 pm
by Apollo
Every frame is too much like work. ;)

Re: Random tidbit for those animating in MAX

Posted: Tue May 01, 2012 9:47 pm
by Zax
Nielk1 wrote:
Apollo wrote:If you don't use autokey and set the keys manually, the interpolation should be ok in bz2.
Incorrect. This is only true if you set a keyframe on every frame, which makes it hard to maintain and edit.

Yes you can set max to linear, but its not a global setting, you have to do it per individual key frame pair.
Take a hybrid solution. Keep a save of pre-export for editability, which you then modify into a new iteration with keyframe on every frame.

That is, this all only applies if your animation absolutely DEPENDS on the max interpolation to succeed, so your swinging door or rotating walker arms will probably be fine.

Re: Random tidbit for those animating in MAX

Posted: Tue May 01, 2012 9:55 pm
by MrTwosheds
Hmm, seems a bit complicated to me. I just skin animated my Dalek turrets head. It was the bit where I had to make an envelope for its 247 vertex that was tricky, the actual animation to move it is really simple.
AnimationSet {
Animation anim-deploy {
{frm-hp_head}
SI_AnimationKey {
2;
2;
0; 3; 0, 0, 0;;,
30; 3; 0, -0.4, 0;;;
2 key frames -0.4 down. Animation looks great. It ducks.

Re: Random tidbit for those animating in MAX

Posted: Tue May 01, 2012 11:17 pm
by Nielk1
In BZ2, it moves a set distance every interpolated frame.
In MAX's default setup, it moves a different amount ever interpolated frame, sort of like it accelerates and then decelerates.

Re: Random tidbit for those animating in MAX

Posted: Mon May 07, 2012 9:01 am
by bigbadbogie
*Slaps self*

That's what you mean!

I've just learned to imagine what the animation would actually look like in the game and ignore the way that Max does that.

I don't even think about it any more, unless I am animating walkers. Then it can actually get a bit annoying trying to stop the feet from going through the ground.

Re: Random tidbit for those animating in MAX

Posted: Mon May 07, 2012 4:50 pm
by MrTwosheds
You should be able to adjust them back to something more like the original by lightly tweaking the keyframe numbers in notepad.
Probably never going to be as smooth as they appear in Max though.

Re: Random tidbit for those animating in MAX

Posted: Mon May 07, 2012 4:55 pm
by Nielk1
MrTwosheds wrote:You should be able to adjust them back to something more like the original by lightly tweaking the keyframe numbers in notepad.
Probably never going to be as smooth as they appear in Max though.
No, no you can't, since the issue is in the actual movement between frames being an entire order higher or lower.

And yes, yes it can if you put a key-frame on every frame making the interpolation relatively unneeded. It creates a sort of system like how PCs draw curves (as a series of tiny straight lines).

Re: Random tidbit for those animating in MAX

Posted: Mon May 07, 2012 5:33 pm
by MrTwosheds
Well you can. The results may not be exactly what you wanted though.
A rotation that appeared smooth in Max, can be made to accelerate and decelerate by altering the keyframe numbers in notepad, the more frames there are the less crude the effect is, keyframe values can be tweaked to smooth it out as well.
You don't want to add a key to every frame, bz2 is smoothest with as few keyframes as possible.
If you had 30 frames, with 4 keyframes at 1 10 20 30, altering it to 1 9 21 30 or 1 11 19 30 would make it accelerate/decelerate towards 15, but not quite in the uniform manner that 3dsmax would achieve.