Animation

From TrainzOnline
Jump to: navigation, search

Any mesh with a skeleton may have animations applied. Animations in Trainz are stored in the "*.kin" file format. These are created during FBX file import and are referenced in the "mesh-table" Container etc. If a mesh has a skeleton but does not have any animation applied, it will be displayed in its bind pose. Animations are not strongly tied to the mesh from which they are initially exported; they may be reused with any compatible mesh.

Partial Animation

Multiple animations may be applied to a single mesh.

Each animation may affect any subset of the skeleton's bones.

Multiple animations may affect the same bones.

Any bones unaffected by animation remain in the bind pose.

Idle Animations

Whether an animation is actively playing/progressing or not is a separate concept from whether it is applied to the mesh. An animation which is paused but still enabled will still deform its mesh.

Animating Multiple Meshes

An animation file may be reused for multiple meshes. Aside from a small memory saving, this does not have any performance benefits, but can help simplify complex configurations which require multiple meshes to animate simultaneously. As an example of this, a full-body humanoid figure may be animated to walk. The animation is exported. The mesh may then be broken into separate pieces (arms, torso, legs, head) which are added to the scene individually. Finally, the single original animation is applied to each of the pieces. As long as the animation is played in sync on all of the meshes, the humanoid walks as before.

The important thing to understand here is that there are more bones in the animation than exist in any individual mesh. The animation is fully simulated for all bones, but each mesh only receives its appropriate bone transforms.

Personal tools