Class 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.
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
otherWMORoot
Properties
ConvexVolumePlanes
Convex volume planes (MCVP); transports mostly.
public Vector<C4Plane> ConvexVolumePlanes { get; }
Property Value
DoodadDefs
Doodad placements (MODD).
public Vector<SmoDoodadDef> DoodadDefs { get; }
Property Value
DoodadSets
Doodad sets (MODS).
public Vector<SmoDoodadSet> DoodadSets { get; }
Property Value
Fogs
Fog volumes (MFOG).
public Vector<SmoFog> Fogs { get; }
Property Value
GroupInfos
Per-group info (MOGI).
public Vector<SmoGroupInfo> GroupInfos { get; }
Property Value
GroupNames
Group names (MOGN), referenced by byte offset.
public StringBlock GroupNames { get; set; }
Property Value
Header
The root header (MOHD).
public SmoHeader Header { get; set; }
Property Value
Lights
Lights (MOLT).
public Vector<SmoLight> Lights { get; }
Property Value
Materials
Materials (MOMT).
public Vector<SmoMaterial> Materials { get; }
Property Value
Momx
MOMX (11.x, undocumented purpose); preserved opaque.
public ChunkBlob Momx { get; set; }
Property Value
Mver
The WMO format version; 17 for every supported client.
public uint Mver { get; set; }
Property Value
PortalRefs
Portal references from groups (MOPR).
public Vector<SmoPortalRef> PortalRefs { get; }
Property Value
PortalVertices
Portal vertices (MOPV).
public Vector<C3Vector> PortalVertices { get; }
Property Value
Portals
Portals (MOPT).
public Vector<SmoPortal> Portals { get; }
Property Value
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
VisibleBlockVertices
Visible block vertices (MOVV).
public Vector<C3Vector> VisibleBlockVertices { get; }
Property Value
VisibleBlocks
Visible blocks (MOVB).
public Vector<SmoVisibleBlock> VisibleBlocks { get; }
Property Value
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
versionClientVersion
Returns
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
eraExpansion
Returns
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
databyte[]
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
Write()
Serialize this entity.
public byte[] Write()
Returns
- byte[]