Common structures¶
The shared wire-level math and colour primitives (wowdev.wiki Common Types) used across every WoW file format — vectors, matrices, planes, bounding volumes and colours — under their established client names. All are trivially copyable with the exact on-disk layout, so chunk payloads read straight into arrays of them; the numeric vectors bind as zero-copy NumPy views (see Containers).
C2Vector
¶
C2IVector
¶
C3Vector
¶
C3IVector
¶
C4Vector
¶
C4Quaternion
¶
A quaternion with the scalar part LAST on disk (x, y, z, w) — note the difference from math libraries that lead with w.
CAaBox
¶
CRange
¶
CArgb
¶
A color stored as r, g, b, a bytes.
CImVector
¶
A color stored as b, g, r, a bytes — the client's immediate-mode vertex color layout (WMO MOCV, doodad colors).
fixed16
¶
MapObjDefFlags
¶
Bases: IntFlag
WMO placement flag bits (SMMapObjDef.flags).
Attributes:
| Name | Description |
|---|---|
Destroyable |
A destroyable, server-controllable building (e.g. the DeathknightStart tower). |
UseLod |
Also load the _LOD1 WMO, selected by distance (WoD+). |
HasScale |
The scale field is engaged: scale / 1024 applies (Legion+; otherwise 1.0). |
EntryIsFdid |
name_id is a FileDataID to load directly, not a name-table index (Legion+). |
UseSetsFromMwds |
Doodad set indices come from the ADT MWDS chunk (Shadowlands+). |
DoodadDefFlags
¶
Bases: IntFlag
M2 placement flag bits (SMDoodadDef.flags).
Attributes:
| Name | Description |
|---|---|
Biodome |
Sets the internal WDOODADDEF 0x800 flag; meaning unknown (biodome). |
Shrubbery |
Shrubbery; not checked by 6.0.1+ clients. |
Unk4 |
Unknown (Legion+). |
Unk8 |
Unknown (Legion+). |
Unk10 |
Unknown (Shadowlands+); sets flag 0x4 on the PVS doodad. |
LiquidKnown |
SMDoodadDef::Flag_liquidKnown (Legion+). |
EntryIsFdid |
name_id is a FileDataID to load directly, not an MMID index (Legion+). |
Unk100 |
Unknown (Legion+). |
AcceptProjTextures |
Accepts projected textures (Legion+). |
SMMapObjDef
¶
SMMapObjDef(name_id: int = 0, unique_id: int = 0, position: C3Vector | None = ..., rotation: C3Vector | None = ..., extents: CAaBox | None = ..., flags: MapObjDefFlags | None = ..., doodad_set: int = 0, name_set: int = 0, scale: int = 0)
A WMO placement (the 64-byte MODF record of WDT, WDL and ADT): which object, where, and how it is instanced.
name_id
property
writable
¶
The object: an MWID/MWMO name-table reference, or a FileDataID when flags has EntryIsFdid (Legion+). The WDT global-WMO record ignores it and uses the MWMO content.
unique_id
property
writable
¶
Unique instance id across the whole map (WDT global-WMO records leave it unused).
extents
property
writable
¶
extents: CAaBox
The transformed object's bounding box (position plus the rotated extents); culling and collision use it.
doodad_set
property
writable
¶
The WMO doodad set shown by this instance (MODS index, or MWDR when use_sets_from_mwds is set).
scale
property
writable
¶
Scale, 1024 = 1.0, engaged by the has_scale flag (Legion+); padding in older clients.
SMDoodadDef
¶
SMDoodadDef(name_id: int = 0, unique_id: int = 0, position: C3Vector | None = ..., rotation: C3Vector | None = ..., scale: int = 1024, flags: DoodadDefFlags | None = ...)
An M2 (doodad) placement (the 36-byte MDDF record of ADT, reused by the WDL MLDD low-resolution set): which model, where, and at what scale.
name_id
property
writable
¶
The model: an MMID name-table reference, or a FileDataID when flags has entry_is_fdid (Legion+; WDL MLDD entries are always FileDataIDs).
Chunk payload containers¶
Two member types from wowlib.formats own their whole chunk payload encoding
instead of mapping a wire struct: the decoded string-table block (MOTX, MOGN,
MODN, …) and the verbatim blob that preserves opaque or undocumented chunk
payloads byte-for-byte.
StringBlock
¶
A chunk of zero-terminated strings (texture and model filenames, group names), decoded into (offset, value) entries. Other chunks reference entries by their byte offset in the on-disk blob; adding appends, and existing offsets never move.
Entry
¶
at
¶
The string at a byte offset another chunk stored; empty if the offset lands on padding or out of range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
offset
|
int
|
byte offset into the on-disk blob |
required |
Returns:
| Type | Description |
|---|---|
str
|
the referenced string (a mid-entry offset yields the suffix) |
add
¶
Append a string; existing offsets never move.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
string
|
str
|
the string to append (no embedded zero bytes) |
required |
Returns:
| Type | Description |
|---|---|
int
|
the offset the new string starts at - the value to store in referencing chunks |