Skip to main content

gltf/
gltf.rs

1use draco_oxide::io::gltf::GltfTranscoder;
2use std::path::Path;
3
4fn main() {
5    // input file
6    let input_path = "input.glb";
7
8    // output file
9    let output_path = "output.glb";
10
11    // Read input file
12    let input = std::fs::read(input_path).expect("Failed to read input file");
13
14    // Create transcoder with default options
15    let transcoder = GltfTranscoder::default();
16
17    // Transcode and write to file
18    let warnings = transcoder
19        .transcode_to_file(&input, Path::new(output_path))
20        .expect("Transcoding failed");
21
22    // Print any warnings
23    for warning in warnings {
24        println!("Warning: {}", warning);
25    }
26
27    println!("Transcoding complete: {} -> {}", input_path, output_path);
28}