parseVoxScene()
Read the full extended .vox format: every model, the nTRN/nGRP/nSHP scene graph, MATL materials, LAYR layers and keyframes. A file without a scene graph (the base format) samples as its first model at the origin. Headless: import it from @voxolith/renderer/vox in tools.
function parseVoxScene(buffer: ArrayBuffer): VoxScene;Defined in: vox.ts:251
Parameters
| Parameter | Type |
|---|---|
buffer | ArrayBuffer |
Returns
Throws
Error when the magic is not VOX .
parseVox()
Read the first model of a MagicaVoxel .vox file, with its RGBA palette (or MagicaVoxel's default palette when the file has none). Later models, the scene graph and materials are ignored; use parseVoxScene for those. Headless: import it from @voxolith/renderer/vox in tools.
writeVox()
Serialize one model to a MagicaVoxel ".vox" ArrayBuffer (SIZE + XYZI + RGBA). voxels are [x, y, z, colorIndex] with a 1-based colour index; colorFor maps a 1-based index (1..255) to an RGB triple or null (transparent/unused). Pure (no fs) — callers write the returned bytes to disk themselves....