Skip to content

WMO group

A group file holds one chunk of a WMO's geometry — vertices, normals, render batches, collision and per-group lights, fog and liquid. It has two levels: the wrapper (WMOGroup — the format version and the MOGP container) and the container body (WMOGroupBody), which holds the geometry chunks. Both are version-parametric, shown generically as WMOGroup⟨version⟩ / WMOGroupBody⟨version⟩.

Each field carries its chunk FourCC (linking to wowdev.wiki) plus an expansion badge when it is version-restricted (both ends inclusive); a badge-less field exists in every supported version. The badges are generated from the C++ sources, so they cannot drift.

Expansions:VanillaTBCWotLKCataMoPWoDLegionBfASLDFTWW

The group wrapper

WMOGroup

WMOGroup()

One WMO group file, abstract over the client version. A group file holds the 3D model data (geometry, render batches, collision, liquid) for one unit of a world map object. Construct a concrete version with WMOGroup.for_version(expansion); the per-version WMOGroup* classes are subclasses. See https://wowdev.wiki/WMO.

for_version staticmethod

for_version(expansion: Expansion) -> WMOGroup⟨version⟩

Construct the concrete WMOGroup for a client version — the abstract WMOGroup is never instantiated directly. The return type narrows per expansion (a typed overload per Expansion member), so for_version(Expansion.Wotlk) returns a WMOGroupWotlk; a runtime Expansion value yields the AnyWMOGroup 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

The WMOGroupBody base

WMOGroupBody

WMOGroupBody()

The MOGP container payload, abstract over the client version. Construct a concrete version with WMOGroupBody.for_version(expansion).

for_version staticmethod

for_version(expansion: Expansion) -> WMOGroupBody⟨version⟩

Construct the concrete WMOGroupBody for a client version — the abstract WMOGroupBody is never instantiated directly. The return type narrows per expansion (a typed overload per Expansion member), so for_version(Expansion.Wotlk) returns a WMOGroupBodyWotlk; a runtime Expansion value yields the AnyWMOGroupBody 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.

header property writable

The group header leading the MOGP payload.

Geometry

Vertices, normals, texture coordinates, render batches and triangle data.

tangents property writable MOTACata

tangents: ChunkBlob

Tangent arrays (MOTA, Cata+); offset-based layout, kept opaque.

polys property MOPY

polys: list[SMOPoly]

Per-triangle material info (MOPY).

indices property MOVI

indices: list[Annotated[int, uint16]]

Triangle vertex indices (MOVI), three per triangle.

vertices property MOVT

vertices: list[C3Vector]

Vertices (MOVT).

normals property MONR

normals: list[C3Vector]

Normals (MONR).

texcoords property writable MOTV

texcoords: list[list[C2Vector]]

Texture-coordinate sets (MOTV), up to four; the active count is driven by the group flags (has_two_motv, has_three_motv). Dragonflight groups ship a fourth set with no known flag (983 roots' groups in the 10.2.7 fleet client — e.g. Stormwind 8sw_portalroom01 group 2); it engages the fourth slot here. Binds as a list of the filled sets, by value.

batches property MOBA

batches: list[WMOBatch⟨version⟩]

Render batches (MOBA).

Lights

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

polys2 property MNLRSL 9.0

polys2: list[Poly2]

Per-triangle material info v2 (MPY2, 10.0+; replaces MOPY).

Liquid

The liquid grid (water, lava, slime).

liquid property writable MLIQ

liquid: MLIQData

Liquid data (MLIQ): a vertex grid and tile-flag grid with a base position and material id.