Table of Contents

Class WMORoot

Namespace
WoWLib.Formats.WMO.Root
Assembly
WoWLib.dll

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.

public class WMORoot : IDisposable
Inheritance
WMORoot
Implements
Derived
Inherited Members

Constructors

WMORoot()

public WMORoot()

WMORoot(WMORoot)

Copy-construct: a deep copy of other (the C++ copy constructor).

public WMORoot(WMORoot other)

Parameters

other WMORoot

Properties

ConvexVolumePlanes

Convex volume planes (MCVP); transports mostly.

public Vector<C4Plane> ConvexVolumePlanes { get; }

Property Value

Vector<C4Plane>

DoodadDefs

Doodad placements (MODD).

public Vector<SmoDoodadDef> DoodadDefs { get; }

Property Value

Vector<SmoDoodadDef>

DoodadSets

Doodad sets (MODS).

public Vector<SmoDoodadSet> DoodadSets { get; }

Property Value

Vector<SmoDoodadSet>

Fogs

Fog volumes (MFOG).

public Vector<SmoFog> Fogs { get; }

Property Value

Vector<SmoFog>

GroupInfos

Per-group info (MOGI).

public Vector<SmoGroupInfo> GroupInfos { get; }

Property Value

Vector<SmoGroupInfo>

GroupNames

Group names (MOGN), referenced by byte offset.

public StringBlock GroupNames { get; set; }

Property Value

StringBlock

Header

The root header (MOHD).

public SmoHeader Header { get; set; }

Property Value

SmoHeader

Lights

Lights (MOLT).

public Vector<SmoLight> Lights { get; }

Property Value

Vector<SmoLight>

Materials

Materials (MOMT).

public Vector<SmoMaterial> Materials { get; }

Property Value

Vector<SmoMaterial>

Momx

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

public ChunkBlob Momx { get; set; }

Property Value

ChunkBlob

Mver

The WMO format version; 17 for every supported client.

public uint Mver { get; set; }

Property Value

uint

PortalRefs

Portal references from groups (MOPR).

public Vector<SmoPortalRef> PortalRefs { get; }

Property Value

Vector<SmoPortalRef>

PortalVertices

Portal vertices (MOPV).

public Vector<C3Vector> PortalVertices { get; }

Property Value

Vector<C3Vector>

Portals

Portals (MOPT).

public Vector<SmoPortal> Portals { get; }

Property Value

Vector<SmoPortal>

SkyboxName

Skybox filename (MOSB); raw bytes — files pad it to 4-byte alignment. skybox_fdid (MOSI, 8.1+) functionally replaces it, but the chunk never left the corpus: a 9.2.7 client survey (2026-08-08) found MOSB in 5404 of 8148 roots — always empty, never alongside MOSI — so it stays on every version as the no-skybox marker exporters still emit.

public ChunkBlob SkyboxName { get; set; }

Property Value

ChunkBlob

VisibleBlockVertices

Visible block vertices (MOVV).

public Vector<C3Vector> VisibleBlockVertices { get; }

Property Value

Vector<C3Vector>

VisibleBlocks

Visible blocks (MOVB).

public Vector<SmoVisibleBlock> VisibleBlocks { get; }

Property Value

Vector<SmoVisibleBlock>

Methods

Dispose()

Release the native object now. Optional: the finalizer releases it on collection anyway - dispose (or using) when you want native memory back promptly.

public virtual void Dispose()

EnsureValid()

Validate and raise on the first error instead of returning a report — the assert-style face of validate().

public void EnsureValid()

ForVersion(ClientVersion)

A fresh WMORoot for an exact client version — the only axis that can name a Classic client, whose files follow the engine its build was cut on rather than its 1.15 / 4.4 version number.

public static WMORoot ForVersion(ClientVersion version)

Parameters

version ClientVersion

Returns

WMORoot

ForVersion(Expansion)

A fresh WMORoot for the given era, as the family base — the dynamic twin of the typed Era factories.

public static WMORoot ForVersion(Expansion era)

Parameters

era Expansion

Returns

WMORoot

Read(byte[])

Deserialize file bytes into this entity, replacing its contents. Unmodeled chunks are preserved so an unmodified entity rewrites byte-for-byte.

public void Read(byte[] data)

Parameters

data byte[]

Validate()

Check the logical integrity contracts this file must satisfy to LOAD in the client — companion-chunk counts, index ranges, flag/presence coherence — 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.

public ValidationReport Validate()

Returns

ValidationReport

Write()

Serialize this entity.

public byte[] Write()

Returns

byte[]