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.
The group wrapper¶
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
¶
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 |
The WMOGroupBody base¶
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
¶
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.
header
property
writable
¶
header: WMOGroupHeader⟨version⟩
The group header leading the MOGP payload.
Geometry¶
Vertices, normals, texture coordinates, render batches and triangle data.
tangents
property
writable
¶
tangents: ChunkBlob
Tangent arrays (MOTA, Cata+); offset-based layout, kept opaque.
indices
property
¶
Triangle vertex indices (MOVI), three per triangle.
texcoords
property
writable
¶
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.
Lights¶
Static and dynamic lights, and the group references into them.
Liquid¶
The liquid grid (water, lava, slime).