Animations
From NWN1 Custom Content Guide
Contents |
[edit] Introduction
Without movement, a world is a picture... putting movement in however can be tricky, hopefully this page will provide you with a few details which are of help, many of the linked pages contain tables which are a useful asset.
[edit] Supermodels
Which animations are available to which creatures (by default) are regulated by the Supermodel Hierarchy. This allows custom animations to be applied to only a specific race or gender. If you do not wish to inherit animations from the supermodels for example a completely custom model, then this is of limited relevance to you.
| a_ba_casts | a_ba_med_weap | a_ba_non_combat | a_fa (0.988) | pfa0 (0.64 / 0.632) pfe0 (0.894 / 0.883) pfg0 (0.64 / 0.63) pfh0 (1.0 / 0.988) | |
| a_dfa (1.01) | pfd0 (0.65 / 0.648) pfo0 (1.0 / 0.997) | ||||
| a_ba (1.0) | pma0 (0.65) pme0 (0.895) pmh0 (1.0) pmh1 (1.0) pmh2 (1.0) | ||||
| a_da (1.03) | pmd0 (0.66 / 0.68) pmg0 (0.62 / 0.63) pmo0 (1.0 / 1.03) | ||||
Animations in the models on the right override the left.
In brackets is the animation scale value (in mdl / final adjustment from a_ba).
Notes:
- Format of the race supermodels are: p(gender)(raceletter)(phenotype).
- Gender: m/f
- Race: a=halfling, d=dwarf, e=elf, g=gnome, h=human, o=half-orc. Half-elves use the human models.
- Phenotype: 0=normal, 1=skinny (not used), 2=fat.
- Length is in frames (30 frames a second).
- If it is not a looping animation then it will be a fire and forget (one-shot) animation.
- Certain models, (particularly the p* ones) have animations which supercede the other supermodels. For instance, the p?a0 for halflings have different sitting animations due to their obvious shortness.
- Some animation sequences (particularly combat) have a fixed length. They will get scaled if the lengths don't match.
- Supermodeled models inherit the animations from both transforms and rotations.
- Animscale is scaling the whole animation from the model base (0,0,0), hence why halflings stay on the ground instead of being scaled from the rootdummy which is often in the air on the supermodel.
| IMPORTANT: | If you have a sequence called 'default' for helping as a bind pose or something, remember to tell NWMax to not export the sequence when exporting the .MDL! Otherwise NWN will always play the default animation and it overrides all others! |
Musings:
- There are a bunch of supermodel files (a_gnome, a_dwarf, a_elf, etc.) which to my knowledge aren't reference from what I could discover, seems they are legacy files.
[edit] Sequences
Some animation sequences, someone needs to write more on this too:
- Creature Animation List
- PC Animation List (sorted by file)
- PC Animation List Sorted (sorted by sequence name)
- PC Animation List Grouped (sorted by group)
[edit] Animation Scale
The speed of animations is played out in the mdl files, when you inherit these animations for a custom creature you may wish to change the speed, the animation scale allows you to do this.
[edit] Transitions
Animations can be built out of several parts, eg when a player goes to sit, they go from standing to sitting on the ground, and then sit on the ground swaying slightly, these are two separate animations, the transition speed between the end point of one and the start of the other can be controlled
Todo: Confirm this.
[edit] Events
There is a selection of Animation Events, which are triggered during the animation to achieve synchronised sound effects and special animation effects like weapon blur.
Todo: How to use events in your animation.
[edit] Kinematics
[edit] Forward Kinematics (FK)
| Image:Fk legs1.jpg | When animating a body, it is usual to animate a 'skeleton' this is normally a rough stick-figure for a human model, the picture on the left shows basic model for the animations that exists in in (source a_ba.mdl), the view port being from the left.
With FK, rotating the thigh results in all the connected nodes further down to be rotated in unison, you'll note in the picture on the right the shin and foot move as if one fixed model part, later we could then rotate the shin and have the foot and shin move together. | Image:Fk legs2.jpg |
[edit] Inverse Kinematics (IK)
As it's name suggests IK is roughly the opposite to FK, in that we control the foot and the shin and thigh move, though the body parts are already connected together by the model importer, a requirement of doing FK or IK.. IK also needs to know what parts of the body are under the control, so by selecting the foot, you can set up an IK chain using the animation pull down menu (ik solvers) and then click on the thigh. a while line appears between the top of the foot and the top of the thigh, along with a line though the bones controlled by the IK.
This time instead of using the rotate tool, by selecting the IK control on the foot and moving it, the leg bends at the knee to allow the foot to raise, though this only demonstrates a simple leg, spiders legs with multiple joints can also be animated with IK. You may also note the foot, in this case has been rotated to remain straight to the leg, this is both a oversight and a demonstration of how IK and FK can mix together.
[edit] When and How to use them
Though IK is a very powerful tool for moving things quickly without hassle, it can sometimes come up with 'un-natural' solutions to limb placement when pushed to strange angles. IK tends to be more 'natural' in how a body moves - i.e. move your mouse around right now and notice where your focus is on: the hand. You move the hand, and the rest of your arm moves accordingly to adjust for the new position. But as mentioned, you need a lot of controllers to handle IK to account for odd joint movements. For instance, a common practice under Maya is to set up an IK handler on your arm or leg with a rotate plane for where the knee or elbow points towards, to prevent it from going the wrong way.
FK is more taxing on the animator, as he has to manually adjust every bone, but it does allow for precise positions to be achieved.
To switch between IK and FK, disable or delete the IK node.
Also note, that NWN (and NWMax) are FK, the calculations required for IK is too taxing to be implemented, but you can use IK for NWN. What you have to do is 'bake' the resulting animations from the IK sequence to the bones, which essentially converts it to FK. Then use the keyframe optimizer to remove any redundant keys and export away. Obviously save the scene to another name (i.e. horse.max and horse_baked.max) so you can always return to the IK scene and adjust something.
| From Thri | I should post a pic of one of my Maya IK rigs, like the horse's! =) |
[edit] Subsections
Adding Custom Creature Animations
Main Page | Animations
