Animation lives in the keyframer chunk, B000 (lib3ds KFDATA),
next to the 3D editor chunk in the main chunk. It
builds the scene’s hierarchy out of nodes, one per animated thing, each naming an
object from the editor, and gives every node tracks of keys for its position,
rotation, scale and other values. The keyframer also stores the hierarchy itself, so
a file needs it for parent and child objects even when nothing moves.
Keyframer settings
| ID | Name | Data | Meaning |
|---|---|---|---|
B00A | KFHDR | word, strz, dword | Revision, scene name, and the length of the animation in frames |
B008 | KFSEG | 2 dwords | First and last frame of the active segment |
B009 | KFCURTIME | dword | The current frame |
7001, 3000 | VIEWPORT_LAYOUT, DEFAULT_VIEW | The keyframer’s own screen layout, as in the editor |
Node tags
Each node is one chunk. Its ID says what kind of thing it animates; it has no data of its own, only sub-chunks.
| ID | Name | Node for | Tracks it can have |
|---|---|---|---|
B001 | AMBIENT_NODE_TAG | The ambient light | Colour |
B002 | OBJECT_NODE_TAG | A mesh, or a dummy object | Position, rotation, scale, hide, morph |
B003 | CAMERA_NODE_TAG | A camera | Position, field of view, roll |
B004 | TARGET_NODE_TAG | A camera’s target | Position |
B005 | LIGHT_NODE_TAG | An omni light | Position, colour |
B006 | L_TARGET_NODE_TAG | A spotlight’s target | Position |
B007 | SPOTLIGHT_NODE_TAG | A spotlight | Position, colour, hotspot, falloff, roll |
Node sub-chunks
| ID | Name | Data | Meaning |
|---|---|---|---|
B030 | NODE_ID | word | The node’s number, unique in the file, used by children to name their parent |
B010 | NODE_HDR | strz, word, word, word | Object name, flags 1, flags 2, parent node number (65535, that is −1, for none) |
B011 | INSTANCE_NAME | strz | Instance name; for a dummy object, whose header name is $$$DUMMY, this is its real name |
B013 | PIVOT | vector | Pivot point, the centre of rotation and scaling |
B014 | BOUNDBOX | 2 vectors | Bounding box minimum and maximum |
B015 | MORPH_SMOOTH | float | Morph smoothing angle |
B020–B029 | Tracks | See below |
The object name in B010 matches a named
object in the editor; a target node uses its camera’s or light’s name. Parents
are found through B030; when a file has no B030 chunks,
lib3ds numbers the nodes from 0 in file order.
| Flags word | Bit | Meaning |
|---|---|---|
| Flags 1 | 11 (0x0800) | Hidden |
| Flags 2 | 0 (0x0001) | Show path |
| Flags 2 | 1 (0x0002) | Animate smoothing |
| Flags 2 | 4 (0x0010) | Object motion blur |
| Flags 2 | 6 (0x0040) | Morph materials |
Tracks
| ID | Name | Value of each key |
|---|---|---|
B020 | POS_TRACK_TAG | vector: position |
B021 | ROT_TRACK_TAG | float, vector: an angle in radians and the axis it turns about |
B022 | SCL_TRACK_TAG | vector: scale in x, y and z |
B023 | FOV_TRACK_TAG | float: field of view in degrees |
B024 | ROLL_TRACK_TAG | float: roll in degrees |
B025 | COL_TRACK_TAG | vector: red, green, blue |
B026 | MORPH_TRACK_TAG | strz: the name of the object to morph into |
B027 | HOT_TRACK_TAG | float: hotspot angle in degrees |
B028 | FALL_TRACK_TAG | float: falloff angle in degrees |
B029 | HIDE_TRACK_TAG | Nothing: each key toggles the object between shown and hidden |
Each track chunk holds:
| Offset | Size | Type | Meaning |
|---|---|---|---|
| 0 | 2 | word | Track flags; see below |
| 2 | 8 | bytes | Unknown |
| 10 | 4 | dword | Number of keys |
| 14 | … | keys | The keys, one after another |
Each key is:
| Type | Meaning |
|---|---|
| dword | Frame number |
| word | Which spline parameters follow: bit 0 tension, bit 1 continuity, bit 2 bias, bit 3 ease to, bit 4 ease from |
| float × bits set | The parameters present, in that order: tension, continuity and bias from −1.0 to 1.0, ease to and ease from from 0.0 to 1.0 |
| Track’s value | As in the table above |
The parameters are those of Kochanek–Bartels (TCB) splines, which 3D Studio uses to interpolate between keys. Rotation keys are relative: each turns the object from where the previous key left it, so the rotations have to be combined in order to get the absolute orientation at a key.
Track flags
The two main sources disagree on these bits:
| Bits | 3dsinfo.txt | lib3ds |
|---|---|---|
| 0–1 | 0 single, 2 repeat, 3 loop | Bit 0 repeat, bit 1 smooth |
| 3 | Lock x | Lock x |
| 4 | Lock y | Lock y |
| 5 | Lock z | Lock z |
| 7 | Unlink x | None |
| 8 | Unlink y | Unlink x |
| 9 | Unlink z | Unlink y |
| 10 | None | Unlink z |
The lock bits agree. Which of the two is right for the loop and unlink bits has not been settled by any public source.