News:

Happy 20th, FFvT3R!

Main Menu

Nifskope Animation Made EZ

Started by SickAlice, February 06, 2023, 08:01:21 PM

Previous topic - Next topic

SickAlice

So this is a quick tutorial on positioning in nifs and keyframes. A Nif file is a container. A KF file is not really a different format. In most Nif based games the keyframe animations are contained in the nif along with model. Often much more is in the nif, even the textures and sounds at times.

At the same time these things can be separated depending on how a game engine is set up. In the case of  :ff: games as other moddable game the keyframes are set up in a second file with the the extension .kf when it comes to animated characters. The files are likewise in specific directories that the game engine requires, much of this to make it easier for players to change how the characters look and move. Where things like FX are set-up with the keyframe animations inside the nif itself.

Inside a nif file there are several things. Among them is a 3d model. If they are a character to be animated they will also have bone nodes. The nodes have string names. Here is Biped 01 in a male basic nif. Biped 01 is responsible for the entire model.


It's typical for the rest pose inside a nif to match the character idle keyframe. Not always but this is the case here. Opening up the kf file in another Nifskope instance we can look at the idle animation and find the string name for Biped 01.


All the other bone names and other node string names can be found inside each keyframe animation as well. Now we will go back to our nif and look at the positional values. On Biped 01 I right click, then Transform > Edit and a pop-up window displays.

- In the window there is the Translations which are the positions in 3d space. Left to right, back to forward, up to down. These are represented by the colored arrows in the preview plane.
- There are Rotations which is the position on any points center axis. So the whole model for example is on it's center axis. Each bone/biped as well which determines the rotation of a body part, here in Biped 01 it is for the whole model. These are represent by small spheres on the end of a line sticking at of the center position where they are placed.
- Lastly there is the Scale. This is of course the size of the selected item.


Leaving that pop-up window open we go back to our kf that we have open in a different instance of Nifskope. The pop-up will follow over to that instance as seen here.

Opening up the Biped 01 keyframe in the idle animation we see Quarternions, Translations and Scales. Quarternions are Rotations. Translations and Scales are the same as in the nif. As you can see in the idle the settings for Biped 01 are the same as in the nif. This will be the case for all of the bones and other nodes.


Changing the numbers in the keyframe settings will cause an animation. This is done relative to the idle pose. Also, to make work easy one can pose the model inside the Nif and then copy over the positions to the keyframes. On top of that one can copy the values from the keyframes to the nif to also get values. Think of the nif as a poseable doll. Save that nif as copy, you don't want to use it in game. Just for work. The character.nif you use in game must retain it's idle rest pose.

Here is an example a nif that I already posed to match an animation called "idle_sit". I will select Biped 01 here as well and open the pop-up window. You can see there are different numbers here. In this case the Z Translation I have highlighted. Changing the Z Translation moved Biped 01, the entire model, south of it's original position.


Now I go back to the kf file and the pop-up follows me. I'm looking at the idle_sit animation and it's Biped 01 keyframes. You can see here the numbers in the Translation match the new numbers in the pose. This again is the case for all the values in the idle_sit animation.


That is how positions in nifs and keyframes work. Here is the results in CTool2 of what I showed you. First the original idle animation.


Second the new idle_sit animation.


Hopefully I made this as straightforward as possible and it is of good use to anyone. Keyframe animations are actually very easy, it helps to have your calculator open of course. They just take a long time is all.


cranlox

amazing!
I definitely have to look at it much calmer because I found almost nothing of what you explained in detail. Thanks for the tutorial on behalf of the community

eluvium

thank you I was just htinking about this

SickAlice

I was working on a long standing request for a pegasus (byd_pegasus) I've seen floating around here and thought I would screen capture it since I am using this process. Pardon the junky screencaps and gifs. I'm working with freeware and quickly just to get examples down.

So short version. This is the character nif. It is our old friend byd_horse. I skoped the wings from INK's mimic on to it since I liked the bone set up and thought the span worked for the overall look. I will be remapping the wings so both sides can be textured later on and then use RD's weigh copying process to fix it.



The wings fall into the horse model in a way I do not like. Also we always want the idle animation present in every keyframe anyway so it is accounted for and most models including this horse are based in male_basic (generic hero or Taskmaster) and we want those bones in all the keyframes so we can make them move later. So this is another nif I saved called "idle.nif" and I copied the new wing bong values into the Idle animation.



These are three separate nifs that account for the animations during fly and hover states called "fly1.nif, fly2.nif and fly4.nif". The wing animation sequence goes "fly1, fly2, fly1, fly4". This is all a reproduction of an animation from a certain animated cartoon which some of you can guess.



I then copied these values into the fly and hover animations making four sets for each. Then adjusted the time values. In this case there are four values but they start at zero so we take the end time of an animation and divide by three then subtract that twice from the end value to get the times for the second and third keyframes. These are previews, shoddy gifs mind you where the real thing is seamless, of the Idle and Fly animations.





Luckily the horse does not have many animations so it will be easy to finish this. Likewise again there is a basis in Idle for every animation where those wing positions can be copied and will simply move with the rest of the model via the bone they are attacked to which is the neck. Else I will have to adjust Clamp and Cycle settings for each which is just a double click.

On a side a time saving tip. Instead of copying each individual keyframe at the end the nif copy an already set up animation set and do it as many times as needed. Give it all a unique name. Then work on those animations where they sit and copy over the string values once your done and then delete the extra keyframes (the newly assigned will save the keyframes from being deleted).

cranlox

Extraordinary work with the Pegasus, I quickly come up with Pegasus characters from cartoons, from SheeRa, Hercules, and My Little Pony :thumbup:

BentonGrey

Wow, that's really cool, SA!  The technical side is beyond me, but thank you for sharing all of this knowledge with the community!
God Bless
"If God came down upon me and gave me a wish again, I'd wish to be like Aquaman, 'cause Aquaman can take the pain..." -Ballad of Aquaman
Check out mymods and blog!
https://bentongrey.wordpress.com/


SickAlice

Making an extended project but I will release the basic one first and very soon. I have to add the string names and that's about it.

SickAlice

Quote from: BentonGrey on October 28, 2025, 04:05:00 PMWow, that's really cool, SA!  The technical side is beyond me, but thank you for sharing all of this knowledge with the community!

It's very easy just tedious and time consuming. I have carpal tunnel which is the only hold-up. Else refer yourself to Windblowns tutorial here. All I'm doing is expanding on that.

https://thelitterbox.freedomforce4ever.com/pages/workbench.html