Skip to content

Commit

Permalink
Add endian argument to anim import
Browse files Browse the repository at this point in the history
  • Loading branch information
PikminGuts92 committed Feb 10, 2025
1 parent 11b583a commit a7c195d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions apps/cli/mesh_tool/src/apps/anim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,27 @@ pub struct AnimApp {
pub anim_path: String,
#[arg(help = "Path to output directory", required = true)]
pub output_path: String,
#[arg(short, long, help = "Use big endian serialization")]
pub big_endian: bool,
}

// TODO: Get from args
const SYSTEM_INFO: SystemInfo = SystemInfo {
version: 25,
platform: Platform::X360,
endian: IOEndian::Little,
};

impl SubApp for AnimApp {
fn process(&mut self) -> Result<(), Box<dyn Error>> {
// TODO: Get from args
let system_info: SystemInfo = SystemInfo {
version: 25,
platform: Platform::X360,
endian: if self.big_endian {
IOEndian::Big
} else {
IOEndian::Little
},
};

let importer = GltfImporter2::new(&self.anim_path)?;
let assets = importer.process();

assets.dump_to_directory(&self.output_path, &SYSTEM_INFO)?;
assets.dump_to_directory(&self.output_path, &system_info)?;

Ok(())
}
Expand Down

0 comments on commit a7c195d

Please sign in to comment.