aboutsummaryrefslogtreecommitdiff
path: root/src/bin/gltf.rs
blob: 323b6d235fd1c4f525a7038b20bcdb1173d4452b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![feature(array_chunks)]
use anyhow::anyhow;
use std::{env::args, fs::File, io::BufReader};
use unity_tools::{serialized_file::SerializedFile, unityfs::UnityFS};

fn main() -> anyhow::Result<()> {
    env_logger::init_from_env("LOG");
    let file = || BufReader::new(File::open(args().nth(1).unwrap()).unwrap());
    let mut fs = UnityFS::open(file())?;
    // let mut fs2 = UnityFS::open(file())?;

    let cabfile = fs
        .find_main_file()
        .ok_or(anyhow!("no CAB file found"))?
        .to_owned();

    let mut cab = fs.read(&cabfile)?;
    let file = SerializedFile::read(&mut cab)?;
    for _ob in file.objects {}

    Ok(())
}