Class M2Wotlk
A whole model for one client version: the MD20 body with skins and external sequence data baked in. A written model is canonical-layout and re-reads equal (no byte-perfect guarantee for offset formats). See https://wowdev.wiki/M2.
public class M2Wotlk : M2, IDisposable
- Inheritance
-
M2Wotlk
- Implements
- Inherited Members
Constructors
M2Wotlk()
public M2Wotlk()
M2Wotlk(M2Wotlk)
Copy-construct: a deep copy of other (the C++ copy constructor).
public M2Wotlk(M2Wotlk other)
Parameters
otherM2Wotlk
Properties
Root
The MD20 body — the model's root, uniform across every era (pre-Legion it IS the file; Legion+ it is the decoded MD21 image, whose transport blob chunks drops after read).
public M2RootWotlk Root { get; set; }
Property Value
Skins
The model's LOD views, in view order ("{model}0N.skin" files, WotLK+). The source of truth for the view count: write() stamps the body's num_skin_profiles layout field from this vector's length.
public Vector<SkinWotlk> Skins { 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 override void Dispose()
EnsureValid()
Validate and raise on the first error instead of returning a report — the assert-style face of validate().
public void EnsureValid()
Read(FileSystem, FileKey)
Load the model and all its satellite files from a client filesystem, replacing this entity's contents.
public void Read(FileSystem fs, FileKey key)
Parameters
fsFileSystemthe filesystem gateway
keyFileKeythe .m2 file identity (path and/or FileDataID)
Validate()
Check the logical integrity contracts this model must satisfy to LOAD in the client — across the body AND every skin — which write() deliberately never enforces. Call it before writing when you want to know the model will load. A model read from a client and left unmodified reports no errors; warnings mark states real client files ship.
public ValidationReport Validate()
Returns
- ValidationReport
every violated contract, each with its member path ("root..." / "skins[i]...")
Write(FileSystem, FileKey)
Serialize and store the model and every satellite file through the filesystem's project overlay; satellite names derive from the key, which must resolve to a path.
public void Write(FileSystem fs, FileKey key)
Parameters
fsFileSystemthe filesystem gateway
keyFileKeythe .m2 file identity; must resolve to a path