WMO root¶
The root file holds everything shared across a WMO's groups — materials,
doodads, lights, fog, portals and the group table. It is version-parametric:
the layout differs by client version, which wowlib models as one
WMORoot<version> per expansion (Python: WMORootWotlk, WMORootShadowlands,
…). Rather than repeat twelve near-identical class listings, this page
documents the generic model, shown generically as WMORoot⟨version⟩.
Each field carries its chunk FourCC (linking to wowdev.wiki). A field whose availability is version-restricted also carries an expansion badge (both ends inclusive); a field with no badge exists in every supported version. The badges are generated from the C++ sources, so they cannot drift. Fields are grouped into sections by area (materials, geometry, lights, …); a chunk that was removed in a later client still appears in its section, its badge showing where it went away.
The WMORoot base¶
WMORoot
¶
A WMO root file, abstract over the client version. The root file lists the object's shared data (materials, doodads, portals, lights, fog and the group table); the geometry lives in the separate group files. Construct a concrete version with WMORoot.for_version(expansion); the per-version WMORoot* classes are subclasses. See https://wowdev.wiki/WMO.
for_version staticmethod¶
for_version(expansion: Expansion) -> WMORoot⟨version⟩Construct the concrete WMORoot for a client version — the abstract WMORoot is never instantiated directly. The return type narrows per expansion (a typed overload per Expansion member), so for_version(Expansion.Wotlk) returns a WMORootWotlk; a runtime Expansion value yields the AnyWMORoot union.
validate
¶
Check the logical integrity contracts this file must satisfy to LOAD in the client, which write() deliberately never enforces. Call it before writing when you want to know the result will load. A file read from a client and left unmodified reports no errors; warnings mark states real client files ship.
Returns:
| Type | Description |
|---|---|
ValidationReport
|
every violated contract, each with its member path |
ensure_valid
¶
Validate and raise on the first error instead of returning a report — the assert-style face of validate().
Returns:
| Type | Description |
|---|---|
None
|
nothing; raises when validate() finds any error |
Fields¶
Header¶
The file version and the root/group header.
mver
property
writable
¶
The WMO format version; 17 for every supported client.
Materials¶
The material table, shaders and texture references.
textures
property
writable
¶
textures: StringBlock
Texture filenames (MOTX); the material texture fields index into this block. Pre-8.1 it is the primary reference; in 8.1/8.2 its presence marks the fallback mode (MOMT texture fields are MOTX offsets, not FileDataIDs). Removed at 8.3, when the client dropped name-based texture loading.
Lights¶
Static and dynamic lights, and the group references into them.
Portals¶
Portal geometry linking groups for visibility.
Fog¶
Fog volumes and the group references into them.
Culling¶
Visibility blocks and convex culling volumes.