use std::{fs::File, io::BufReader, path::PathBuf}; use fbxcel_dom::any::AnyDocument; pub fn main() { env_logger::init(); let path = match std::env::args_os().nth(1) { Some(v) => PathBuf::from(v), None => { eprintln!("Usage: load-dom "); std::process::exit(1); } }; let file = File::open(path).expect("Failed to open file"); let reader = BufReader::new(file); match AnyDocument::from_seekable_reader(reader).expect("Failed to load document") { AnyDocument::V7400(ver, doc) => { println!("Loaded FBX DOM successfully: FBX version = {:?}", ver); for scene in doc.scenes() { println!("Scene object: object_id={:?}", scene.object_id()); let root_id = scene .root_object_id() .expect("Failed to get root object ID"); println!("\tRoot object ID: {:?}", root_id); } } _ => panic!("FBX version unsupported by this example"), } }