export_glb_from_meshes

Function export_glb_from_meshes 

Source
pub fn export_glb_from_meshes(
    positions: &[f32],
    normals: &[f32],
    indices: &[u32],
    vertex_counts: &[u32],
    index_counts: &[u32],
    colors: &[f32],
    origins: &[f64],
    express_ids: &[u32],
    include_metadata: bool,
    lit: bool,
    emissive: bool,
) -> (Vec<u8>, GltfStats)
Expand description

Assemble a GLB from already-produced meshes (the viewer’s MeshData — no re-meshing). Per mesh i: vertex_counts[i] vertices + index_counts[i] indices, taken in order from the concatenated positions/normals/indices; colors is RGBA per mesh, origins is xyz per mesh, express_ids labels each mesh. Indices are per-mesh LOCAL. Callers pass exactly the meshes they want emitted (visibility filtering is theirs).

NOTE: on malformed input — a vertex_counts/index_counts entry that runs past the end of the flattened buffers — this stops at the first un-backed mesh and returns the valid prefix, so a caller bug ships a GLB missing the model’s tail as “success”. Use try_export_glb_from_meshes to turn that into ExportError::MalformedMeshInput.