export_gltf_streaming

Function export_gltf_streaming 

Source
pub fn export_gltf_streaming(
    content: &[u8],
    opts: &GltfOptions,
    chunk_cap: usize,
    sink: impl FnMut(GltfBuffer),
) -> Vec<u8> ⓘ
Expand description

Export a model as a multi-buffer glTF: the .gltf JSON (returned) plus one or more external .bin buffers, each kept under chunk_cap bytes (well below the 4 GiB glTF limit), so a model of ANY size loads as one logical model. Each finished buffer is handed to sink and dropped, so peak memory is ~one chunk, not the whole model — this is the path for models too large for a single GLB (try_export_glb* stays the smaller-model path). Compose with GltfOptions.quantize to shrink first.