NIF Animation Data and Keys
This article is incomplete. You can help by filling in any blank descriptions. Further information might be found in a section of the discussion page. Please remove this message when no longer necessary. |
Without getting into too much semantics, all animations can generally be expressed as a curved line with points representing distinct changes at given times. These points can indicate movement, rotation, or changes in a particular value. You can fill the gaps between these points through interpolation, and you can provide additional information with these points to further adjust how they are interpolated, and Gamebryo supports five methods of providing these points (or keys) in data blocks.
Contents
Key Types
Linear Keys
A key whose data is interpolated at a constant, unmodifiable rate. Imagine a line that is always straight between points.
Quadratic Keys
A key whose data is interpolated with tangents that modify the "curve" of the value over time. Imagine a line that curves at the beginning, ramping upward and smoothing back down as it approaches the end.
TBC Keys
A key whose data is interpolated with tangents that modify the **T**ension, **C**ontinuity, and **B**ias each point has along the line. Imagine a line with points that are tauter or slacker, can inhibit influence from the previous point, or influence the following and preceding curves more strongly.
XYZ Rotation Keys
Creates a set of keys that represent rotation on the local X, Y, and Z axes that can use different interpolation types individually.
Constant Keys
A key whose data is not interpolated between points. Imagine a line that is flat and goes either straight up or down when it hits a point with a different value than the previous point.
RGBA Color Keys
A key that contains color information in hex and can be interpolated with one of the methods above, aside from XYZ Rotation.
Data Blocks
Keys are stored in special blocks that are attached to NiInterpolators which store the interpolated value for controllers they are attached to.
NiBoolData
Stores boolean (0 or 1) values with Constant Key interpolation. Only used by NiBoolInterpolators.
NiColorData
Stores an RGBA color key. Typically used for NiPSysColorModifiers.
NiFloatData
Stores floats (whole numbers with six decimals of precision) that supports all but XYZ and Color key interpolation. Only used by NiFloatInterpolators.
NiPosData
Stores a trio of floats and supports all but XYZ and Color key interpolation. Only used by NiPoint3Interpolators.
NiRotData
No examples have been found in over 100 games, unknown what interpolator is intended to use these. Possibly only used internally and rotational data in NiTransformData is converted to it.
NiTransformData
Stores 3D transform and scale data in all but XYZ and Color key interpolation, and rotational data in XYZ key interpolation. Only used by NiTransformInterpolators.
Notes
- Quadratic animation keys are internally referred to as Bezier animation keys, but the interpolation is actually Hermite due to Gamebryo being built with Autodesk Maya support in mind.