News:

Rings of Reznor!

Main Menu

Some Keyframe 'Skopin Basics

Started by White Knight, November 24, 2009, 04:44:54 AM

Previous topic - Next topic

White Knight

In the past year a few people have asked me to help with Nifskoping some keyframes,  One common problem seem to be that after combining some keyframes a mesh will flip on to it's side during some animations.

I recently PMed someone the way to fix this.  Although I was addressing a specific issue, I think that I gave a pretty good overview on the basics of Nifskoping keyframes.  I just wanted to post this in hope others might find it useful.

Quote from: White Knight on November 24, 2009, 04:35:03 AM
To begin with, I assume that you are working with FFvTTR Keyframes.  If your Keyframe heirarchy doesn't look like what is in my pictures, then I'm probably wrong and need to rewrite this for FF Keyframes.

I need to stress, working with keyframes seems to involve a lot of trial and error or maybe I should say trial and lots and lots and lots of error.  Backup your work often.

First open the keyframe file in NifSkope.  You will need Block List and Block Details.  Its also helpful if you use Show Blocks in Tree.



Open up the NiControllerSequence corresponding to a animation sequence.  In this case Idle.



The first line under that will be NiTextKeyExtraData.  Select that line and Look at the Block Details.  I won't go in to details at this time, but this is where you can add, remove, or change things like contact and leave_hand.



The rest of the lines under NiControllerSequence will be NiKeyframeController.  Each one of these corresponds to a NiNode in the Mesh.

Open up any of the NiKeyframeController lines and under that will be a NiKeyframeData line. <cue dramatic music> This is it, the heart and soul of the Keyframe file.  Okay enough drama, this is what controls all motion or position of the corresponding NiNode during the animation sequence.

Select the NiKeyframeData line and look at the Block Details.  The three lines of main importance are Quaternion Keys (controls rotation), Tranlations (controls movement), and Scales (controls size).



Open up any of those lines (in this case Quaternion Keys), and you'll find a number of Keys. Each one represents a point in the animation sequence where the corresponding NiNode will be changed.

If you open up any one of those keys you will find a time line and a value line.  The time line contains the time during the animation sequence at which this change will occur.  The value line contains the new position, orientation or size.




Okay, now to solve your problem.  The mesh "laying down" in some animations suggests that there is something wrong in the rotation of a NiNode effecting the entire mesh.  What you need to do is change every Quaternion Key in the NiKeyframeData corresponding to the highest NiNode (usually Bip01).

It would be helpful to get an idea of what the proper Quaternion Key values are.  Select an animation in which the mesh is in the proper orientation, and doesn't move too much.  Idle is a good one to use if the orientation is correct.  In Nifskope open the NiControllerSequence corresponding to Idle.  Open the first NiKeyframeController line (I'm almost positive that will correspond to Bip01).  Open the NiKeyframeData then the Main Quaternion Keys line and each Quaternion Keys line under that. Note the values.  That should give you an idea of what the values should be.  Repeat the process with a NiControllerSequence corresponding to an animation where the mesh "lays down".  Compare the values, they should be off by approximately 90.  That should show you what correction needs to be done to every Quaternion Key in that first NiKeyframeData.  I think in the past I've had to either add or subtract 90 from the Y value in the Quaternion Keys.  This can get tediuos in complicated animations.  When this is done, save and check.  Assuming the mesh is in the correct orientation now, you may find that find that the mesh is off center.  If this bothers you (it always does me), you'll need to repeat the whole procedure changing the translation keys.

This really is a simple, although sometimes tedious, procedure.  I wish I could explain it without long labels like NiControllerSequence and Quaternion Keys.  Ya just take that thingy there and change that to that, and there ya go.  Anyway, read through this, email me with questions, and I'm sure you'll get it.

White Knight

 


detourne_me

Hi White Knight, Thanks for this!
I've got a problem though.  I've successfully flipped the keyframes, however the mesh is significantly lower when the new animations play.
like the character drops a few feet, then pops back up when i run a native animation.
I haven't tried this out in-game yet to see.
Do you have any ideas for repositioning the keyframes?

White Knight

Quote from: detourne_me on November 24, 2009, 06:58:24 AM
Hi White Knight, Thanks for this!
I've got a problem though.  I've successfully flipped the keyframes, however the mesh is significantly lower when the new animations play.
like the character drops a few feet, then pops back up when i run a native animation.
I haven't tried this out in-game yet to see.
Do you have any ideas for repositioning the keyframes?

I mentioned this briefly at the end.  This seems to always happen.  To fix it is the exact same procedure, but you'll need to change the Translation Keys instead of the Quaternion Keys.