Expand description
The surface paint chunk (SPEC.md, section 10): what a person painted on
the faces of models, one mask per program, leaf and kind.
Each entry names the program it belongs to, so that one program’s paint never mixes with another’s: a program changes and drops only its own entries. Chunk version 1, which named no program, is still read.
Only the envelope is checked: each entry names a program and a leaf, and
no two entries share a program, a leaf and a kind. Documents are carried
without being read, since a document never makes a file unreadable; the
program that uses the paint checks it against the leaf’s mesh, with
SurfaceEntry::paint or the codecs of crate::paint.
entries u32 count, then per entry:
u32 length, the program's name (not in chunk version 1)
u32 the leaf's node index in the scene chunk
u8 the kind: 0 detail, 1 supports must touch, 2 must not touch,
3 supports both ways
u32 document version
u32 length, documentStructs§
- Surface
Entry - One painted mask of one leaf.
Enums§
- Decode
Surface Error - Why a surface paint payload could not be decoded.
- Encode
Surface Error - Why a list of paint entries could not be encoded.
Constants§
- SURFACE_
TAG - The tag of the surface paint chunk.
- SURFACE_
VERSION - The surface paint payload layout this build writes. It reads version 1 too.
Functions§
- decode_
surface - Decodes a surface paint payload of version
SURFACE_VERSION, checking it againstscene, the scene of the same file. - decode_
surface_ v1 - Decodes a surface paint payload of version 1, whose entries name no
program, checking it against
scene, the scene of the same file. - encode_
surface - Encodes
entriesas a surface paint payload of versionSURFACE_VERSION, in their order, checking them againstscene. Every entry names its program.