use gltf::image::Source;

fn main() {
    let doc = gltf::Gltf::open("models/box.gltf").unwrap();
    for image in doc.images() {
        if let Source::Uri { uri, .. } = image.source() {
            println!("{}", uri);
            let tex_conv_output = std::process::Command::new("build/nvidia-texture-converter/nvtt_export.exe")
            .arg("-q").arg("fastest")
            .arg("-f").arg("bc1")
            .arg("-o").arg(format!("textures/{}.dds", image.name().unwrap()))
            .arg(uri)
            .current_dir("models")
            .output().expect("Failed to run texture converter.");
            println!("{:?}", tex_conv_output);
        }
    }
}