wow_m2/lib.rs
1//! A parser for World of Warcraft M2 model files with version conversion support
2//!
3//! This library allows parsing, validating, and converting M2 model files between different versions
4//! of the World of Warcraft client.
5//!
6//! # Example
7//! ```rust,no_run
8//! use wow_m2::model::M2Model;
9//! use wow_m2::version::M2Version;
10//! use wow_m2::converter::M2Converter;
11//!
12//! // Load a model
13//! let model = M2Model::load("path/to/model.m2").unwrap();
14//!
15//! // Print model info
16//! println!("Model name: {:?}", model.name);
17//! println!("Model version: {:?}", model.header.version());
18//! println!("Vertices: {}", model.vertices.len());
19//!
20//! // Convert to a different version
21//! let converter = M2Converter::new();
22//! let converted = converter.convert(&model, M2Version::MoP).unwrap();
23//!
24//! // Save the converted model
25//! converted.save("path/to/converted.m2").unwrap();
26//! ```
27
28// Re-export main components
29pub mod anim;
30pub mod chunks;
31pub mod common;
32pub mod converter;
33pub mod error;
34pub mod header;
35pub mod io_ext;
36pub mod model;
37pub mod skin;
38pub mod version;
39
40// Re-export common types
41pub use anim::AnimFile;
42pub use converter::M2Converter;
43pub use error::{M2Error, Result};
44pub use model::M2Model;
45pub use skin::{OldSkin, Skin};
46pub use version::M2Version;
47
48// Re-export BLP types from wow-blp crate for backwards compatibility
49pub use wow_blp::BlpImage as BlpTexture;
50
51/// Library version
52pub const VERSION: &str = env!("CARGO_PKG_VERSION");