Skip to content

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.

Expansions:VanillaTBCWotLKCataMoPWoDLegionBfASLDFTWW

The WMORoot base

WMORoot

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

validate() -> ValidationReport

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

ensure_valid() -> None

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 MVER

mver: Annotated[int, uint32]

The WMO format version; 17 for every supported client.

header property writable MOHD

header: SMOHeader

The root header (MOHD).

Materials

The material table, shaders and texture references.

textures property writable MOTXVanilla< 8.3

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.

materials property MOMT

materials: list[SMOMaterial]

Materials (MOMT).

Lights

Static and dynamic lights, and the group references into them.

lights property MOLT

lights: list[SMOLight]

Lights (MOLT).

Portals

Portal geometry linking groups for visibility.

portals property MOPT

portals: list[SMOPortal]

Portals (MOPT).

Fog

Fog volumes and the group references into them.

fogs property MFOG

fogs: list[SMOFog]

Fog volumes (MFOG).

Culling

Visibility blocks and convex culling volumes.

momx property writable MOMX

momx: ChunkBlob

MOMX (11.x, undocumented purpose); preserved opaque.