HI, I'll be happy to provide some commentary here if you're interested in some details.
Some doors in the newer NIF files have animations specified within the NIF. In contrast, OpenMW doors mostly (always?) work by rotating the whole door object. This was exciting for me (and hence decided to post the videos) because I had decoded how various records in the newer NIF files link together (without looking at Nifskope source files) to make the animations work. With the older NIF files they generally work by having all the keyframes baked in and various animations are just played back at different points in time.
Vertex Morph animations
: This one is just using the Ogre Pose Animation
feature. The tricky part is to have the animation configured at the time the meshes are created. OpenMW's vertex animations are done using Ogre::Controller
instead, and at the mesh level (I've decided to do it at sub-mesh level). Well, not sure how they are done now since OpenMW has moved on from Ogre a very long time ago.
There are several challenges with this. Firstly, the character models have to be created. They are put together using various body parts (hair, eyes, head, tails as well as armor/clothes). Some body parts are "skinned
" while others are simply attached to bones
. The ESM/ESP may specify where to find some of these but sometimes the logic seems to be simply hard-coded in the original engine.
Next, Ogre has a limitation(?) where sharing a skeleton instance
requires the meshes to be using the same underlying skeleton template. You can imagine a pair of boots being worn by an Imperial as well as an Argonian - but they have different skeletons! So the boots have to be created for each of the target skeletons. Now, we don't want to re-create the meshes each time (they are cached at a resource manager) so there's a bit of complication on managing these. For now I'm simply encoding an additional string onto the skeleton names.
Finally, with the new NIF, almost all the animations are specified in separate ".kf" files. To do this the links between the various NIF records have to be established from another file. Nifskope does this by simply grafting the whole animation tree onto the skeleton but that seems to take a long time. The current implementation is done similar to the old OpenMW way where Ogre::Controller is created for each of the NIF controllers. This might not be ideal, and possibly have to be reviewed at a later point in time.
(to be continued in another post...)