-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add command line option for importing character anims from gltf
- Loading branch information
1 parent
c322d97
commit ced0814
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use crate::apps::SubApp; | ||
use clap::Parser; | ||
|
||
use std::error::Error; | ||
|
||
use grim::{Platform, SystemInfo}; | ||
use grim::model::*; | ||
use grim::io::*; | ||
|
||
#[derive(Parser, Debug)] | ||
pub struct AnimApp { | ||
#[arg(help = "Path to input animation file (.gltf)", required = true)] | ||
pub anim_path: String, | ||
#[arg(help = "Path to output directory", required = true)] | ||
pub output_path: String, | ||
} | ||
|
||
// 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>> { | ||
let importer = GltfImporter2::new(&self.anim_path)?; | ||
let assets = importer.process(); | ||
|
||
assets.dump_to_directory(&self.output_path, &SYSTEM_INFO)?; | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters