Envelopes and clips are top-level chunks that surfaces refer to by number. Their
contents are sub-chunks, with 2-byte lengths. Types such as VX and
FP4 are explained on Data types
and chunks.
ENVL – Envelope
ENVL { index[VX], attributes[SUB-CHUNK] * }
An envelope makes one parameter change over time, as a series of keys. The index,
any non-zero value below 0x1000000, identifies it; surface parameters
that can be animated end in an envelope[VX] field that refers to an
envelope by this index. The IDs PRE, KEY and TCB are
written with a trailing space.
| Sub-chunk | Layout | Meaning |
|---|---|---|
TYPE | user-format[U1], type[U1] | How the values are shown to the user, and what component the envelope is; see below |
PRE | type[U2] | Behaviour before the first key |
POST | type[U2] | Behaviour after the last key, with the same codes |
KEY | time[F4], value[F4] | A key: the value at a time in seconds, which need not fall on a whole frame |
SPAN | type[ID4], parameters[F4] * | How to interpolate from the key before to the latest KEY |
CHAN | server-name[S0], flags[U2], data | A channel modifier plug-in; bit 0 of flags set means it is disabled; the data belongs to the plug-in |
NAME | channel-name[S0] | An optional name; LightWave ignores names of surface envelopes |
| TYPE user format | Shown as | TYPE type | Component | |
|---|---|---|---|---|
| 2 | Float | 1, 2, 3 | Position x, y, z | |
| 3 | Distance | 4, 5, 6 | Rotation heading, pitch, bank | |
| 4 | Percent | 7, 8, 9 | Scale x, y, z | |
| 5 | Angle | 10, 11, 12 | Colour red, green, blue | |
| 13, 14, 15 | Falloff x, y, z |
| PRE and POST | Behaviour |
|---|---|
| 0 | Reset: the value is 0.0 |
| 1 | Constant: the value of the nearest key |
| 2 | Repeat the interval from the first key to the last |
| 3 | Oscillate: repeat, with every other copy reversed in time |
| 4 | Offset repeat: repeat, each copy offset by the difference between the first and last values |
| 5 | Linear: extend along the tangent at the nearest key |
| SPAN type | Interpolation |
|---|---|
STEP | Hold the previous value |
LINE | Linear |
TCB | Kochanek–Bartels spline (tension, continuity, bias) |
HERM | Hermite spline |
BEZI | One-dimensional Bézier curve |
BEZ2 | Two-dimensional Bézier curve |
Each type stores its own parameters. The description leaves their meaning to the envelope sample in the LightWave plug-in SDK, so the parameter lists are not documented here.
CLIP – Image clip
CLIP { index[U4], attributes[SUB-CHUNK] * }
A clip is an image, a numbered sequence of images or an animation. The index, any
non-zero value below 0x1000000, identifies it; surfaces refer to it by
this number. The first sub-chunk must be one of the five sources; the others modify
the source image as filters, in order, except TIME.
| Source | Layout | Meaning |
|---|---|---|
STIL | name[FNAM0] | A single still image |
ISEQ | num-digits[U1], flags[U1], offset[I2], reserved[U2], start[I2], end[I2], prefix[FNAM0], suffix[S0] | A numbered image sequence. Each file name is the prefix, the frame number in num-digits digits, and the suffix. The offset is added to the current frame to give the number; start and end bound the sequence. The flags hold bits for looping and interlace, whose positions are not given |
ANIM | filename[FNAM0], server-name[S0], flags[U2], data | An animation read by a loader plug-in |
XREF | index[U4], string[S0] | A copy (instance) of another clip, with a unique name for the copy |
STCC | lo[I2], hi[I2], name[FNAM0] | A still with colour cycling: palette entries lo to hi rotate over time, forwards when lo < hi and backwards when hi < lo |
| Modifier | Layout | Meaning |
|---|---|---|
TIME | start-time[FP4], duration[FP4], frame-rate[FP4] | Source timing for an animated clip |
CLRS | flags[U2], colorspace[U2], filename[FNAM0] | Colour space of the image: with flags 0, a code from LightWave’s LWCOLORSPACE list; with flags 1, the name of a colour space file. Added in later LightWave versions |
CLRA | flags[U2], colorspace[U2], filename[FNAM0] | The same, for the alpha channel |
FILT | flags[U2] | Which image filtering to use, as an index. Added later |
DITH | flags[U2] | Which dithering to use, as an index. Added later |
CONT | contrast-delta[FP4], envelope[VX] | Contrast: levels move away from 0.5 for a positive delta, towards it for a negative one; default 0 |
BRIT | brightness-delta[FP4], envelope[VX] | Brightness: the delta is added to the levels; default 0 |
SATR | saturation-delta[FP4], envelope[VX] | Saturation, (max − min) ÷ max of the RGB levels, raised or lowered; default 0 |
HUE | hue-rotation[FP4], envelope[VX] | Rotates the hue, where 0 to 1 is 0° to 360°; default 0 |
GAMM | gamma[F4], envelope[VX] | Gamma correction, stored as the inverse of the power the levels are raised to; 0.0 makes every level 0.0; default 1.0 |
NEGA | enable[U2] | Non-zero inverts the image to its negative |
IFLT | server-name[S0], flags[U2], data | An image filter plug-in, applied before rendering |
PFLT | server-name[S0], flags[U2], data | A pixel filter plug-in, used the same way |
The LWCOLORSPACE codes belong to the LightWave SDK and are not listed in
the format description. The hue is computed from the RGB levels as: when red is the
largest, (g − b) ÷ (r − min) ÷ 3; when green, (b − r) ÷ (g − min) ÷ 3 + 1/3; when
blue, (r − g) ÷ (b − min) ÷ 3 + 2/3, shifted into 0 to 1.