wow-wmo
A comprehensive Rust library for parsing, editing, validating, and converting World of Warcraft WMO (World Model Object) files.
Status
✅ Production Ready - Comprehensive WMO parser with full format support
See STATUS.md for detailed implementation status.
Overview
WMO files represent buildings, dungeons, and other large structures in World of Warcraft. They consist of a root file containing metadata and multiple group files containing geometry data.
Features
Core Functionality
- Parse WMO files from all World of Warcraft versions (Classic through The War Within)
- Parse WMO group files with full geometry and rendering data
- Validate WMO files with detailed error reporting
- Convert WMO files between different versions (upgrading and downgrading)
- Edit WMO files programmatically
- Write WMO files with proper chunk formatting
- Builder API for creating WMO files from scratch
- Tree visualization for inspecting WMO structure
Supported Chunks
- Root file chunks: MVER, MOHD, MOTX, MOMT, MOGN, MOGI, MOSB, MOPV, MOPT, MOPR, MOVV, MOVB, MOLT, MODS, MODN, MODD, MFOG, MCVP, GFID
- Group file chunks: MOGP, MOPY, MOVI, MOVT, MONR, MOTV, MOBA, MOLR, MODR, MOBN, MOBR, MOCV, MLIQ, MORI, MORB, MOTA, MOBS
Installation
Add to your Cargo.toml:
[]
= "0.2.0"
Or use cargo add:
Usage
Parsing a WMO file
use ;
use File;
use BufReader;
// Parse root file
let file = open?;
let mut reader = new;
let wmo = new.parse_root?;
println!;
println!;
println!;
println!;
// Parse group file
let group_file = open?;
let mut group_reader = new;
let group = new.parse_group?;
println!;
println!;
Validating a WMO file
use ;
use File;
use BufReader;
let file = open?;
let mut reader = new;
let wmo = new.parse_root?;
// Validate the WMO
let validator = new;
let report = validator.validate_root?;
if !report.errors.is_empty
for warning in &report.warnings
Converting between versions
use ;
use File;
use ;
let file = open?;
let mut reader = new;
let mut wmo = new.parse_root?;
// Convert from Classic to Cataclysm
let converter = new;
converter.convert_root?;
// Write the converted file
let writer = new;
let mut output = Vecnew;
let mut cursor = new;
writer.write_root?;
write?;
Building a WMO programmatically
use ;
use Cursor;
// Create a simple WMO structure
let wmo = WmoRoot ;
// Write to file
let writer = new;
let mut output = Vecnew;
let mut cursor = new;
writer.write_root?;
write?;
CLI Integration
WMO functionality is integrated into the main warcraft-rs CLI:
# Get information about a WMO
# Validate WMO structure
# Convert between versions
# Visualize WMO structure
# Edit WMO properties
# Build from configuration
Supported Versions
| Version | Expansion | Status |
|---|---|---|
| 17 | Classic - Wrath of the Lich King | ✅ Fully Supported |
| 18 | Cataclysm | ✅ Fully Supported |
| 19 | Mists of Pandaria | ✅ Fully Supported |
| 20 | Warlords of Draenor | ✅ Fully Supported |
| 21 | Legion | ✅ Fully Supported |
| 22 | Battle for Azeroth | ✅ Fully Supported |
| 23 | Battle for Azeroth (8.1+) | ✅ Fully Supported |
| 24 | Shadowlands | ✅ Fully Supported |
| 25 | Shadowlands (9.1+) | ✅ Fully Supported |
| 26 | Dragonflight | ✅ Fully Supported |
| 27 | The War Within | ✅ Fully Supported |
Performance
- Parsing: ~5-50ms for typical WMO files
- Validation: ~1-10ms depending on strictness level
- Conversion: ~10-100ms depending on version gap
- Writing: ~5-20ms for typical files
Examples
The crate includes several examples:
parse_wmo- Basic WMO parsing examplevalidate_wmo- Validation with different strictness levelsconvert_wmo- Version conversion examplebuild_wmo- Creating WMO files programmatically
Run examples with:
Known Issues
- Parser Overflow: Fixed - Group name parsing now handles pointer arithmetic correctly
- Header Size: Fixed - MOHD chunk size corrected to 60 bytes
- Texture Validation: Fixed - Special marker values (0xFF000000+) are now handled
- Light Types: Fixed - Unknown light types default to Omni
- Doodad Structure: Fixed - Always uses 40 bytes for proper round-trip conversion
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.