Table of Contents

Class M2ChunkedFile

Namespace
WoWLib.Formats.M2.Chunked
Assembly
WoWLib.dll

A chunked .m2 shell (Legion+), abstract over the client version. Construct a concrete version with M2ChunkedFile.for_version(expansion); the per-version M2ChunkedFile* classes are subclasses. See https://wowdev.wiki/M2#Chunks.

public class M2ChunkedFile : IDisposable
Inheritance
M2ChunkedFile
Implements
Derived
Inherited Members

Constructors

M2ChunkedFile()

public M2ChunkedFile()

M2ChunkedFile(M2ChunkedFile)

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

public M2ChunkedFile(M2ChunkedFile other)

Parameters

other M2ChunkedFile

Properties

Afra

AFRA (Dragonflight+); not yet observed, kept verbatim.

public ChunkBlob Afra { get; set; }

Property Value

ChunkBlob

AlphaAttenuation

Distance-based model alpha attenuation coefficients (NERF); kept verbatim.

public ChunkBlob AlphaAttenuation { get; set; }

Property Value

ChunkBlob

AnimFdids

.anim FileDataIDs (AFID), one per external (animation, variation) pair.

public Vector<AnimFileEntry> AnimFdids { get; }

Property Value

Vector<AnimFileEntry>

BoneFdids

.bone FileDataIDs (BFID), one per FacePose variant.

public Vector<uint> BoneFdids { get; }

Property Value

Vector<uint>

Dboc

DBOC; undocumented (16 or 32 bytes seen), kept verbatim.

public ChunkBlob Dboc { get; set; }

Property Value

ChunkBlob

Dpiv

DPIV; undocumented, kept verbatim.

public ChunkBlob Dpiv { get; set; }

Property Value

ChunkBlob

EdgeFade

Edge fade data (EDGF), applied to batches with flags2 0x8; kept verbatim.

public ChunkBlob EdgeFade { get; set; }

Property Value

ChunkBlob

ExtendedParticles

Extended particle parameters (EXPT), one per emitter; superseded by EXP2 when both exist.

public Vector<M2ExtendedParticleSimple> ExtendedParticles { get; }

Property Value

Vector<M2ExtendedParticleSimple>

ExtendedParticles2

Extended particle parameters with alpha-cutoff ramps (EXP2), one per emitter.

public Exp2Data ExtendedParticles2 { get; set; }

Property Value

Exp2Data

GeometryParticleModelFdids

Geometry particle model FileDataIDs (GPID), one per emitter.

public Vector<uint> GeometryParticleModelFdids { get; }

Property Value

Vector<uint>

HousingCollision

Player-housing collision mesh (PCOL); offset-based layout, kept verbatim.

public ChunkBlob HousingCollision { get; set; }

Property Value

ChunkBlob

InlinePhys

Inline physics (PFDC): a whole .phys image plus alignment padding, kept verbatim (structured PHYS is a follow-up milestone). wowdev dates it to the 9.0.1 alpha, but 8.3.7 shipped mid-alpha with the backport — 31 item M2s in the fleet client carry it.

public ChunkBlob InlinePhys { get; set; }

Property Value

ChunkBlob

LightDetails

Per-light detail overrides (DETL), kept verbatim: real 9.x files carry 16-byte records where wowdev documents 12 (see M2LightDetail for the known half).

public ChunkBlob LightDetails { get; set; }

Property Value

ChunkBlob

LodData

LOD data (LDV1); layout partially known, kept verbatim.

public ChunkBlob LodData { get; set; }

Property Value

ChunkBlob

ParentEventData

Parent event data (PEDC); offset-based track payload kept verbatim.

public ChunkBlob ParentEventData { get; set; }

Property Value

ChunkBlob

ParentSequenceBlacklist

Parent-model sequence blacklist (PABC).

public PabcData ParentSequenceBlacklist { get; set; }

Property Value

PabcData

ParentSequenceBounds

Parent sequence bounds (PSBC).

public PsbcData ParentSequenceBounds { get; set; }

Property Value

PsbcData

ParentTextureWeights

Parent texture weights (PADC); offset-based track payload kept verbatim.

public ChunkBlob ParentTextureWeights { get; set; }

Property Value

ChunkBlob

ParticleGeosetData

Particle geoset data (PGD1), one geoset per emitter (wowdev dates it to the 1.13.2.30172 classic build — the 8.2.0 retail era).

public Pgd1Data ParticleGeosetData { get; set; }

Property Value

Pgd1Data

PhysFdid

.phys FileDataID (PFID); 0 or 1 entries.

public Vector<uint> PhysFdid { get; }

Property Value

Vector<uint>

RecursiveParticleModelFdids

Recursive (child-emitter) particle model FileDataIDs (RPID), one per emitter.

public Vector<uint> RecursiveParticleModelFdids { get; }

Property Value

Vector<uint>

SkeletonFdid

.skel FileDataID (SKID); 0 or 1 entries.

public Vector<uint> SkeletonFdid { get; }

Property Value

Vector<uint>

SkinFdids

.skin FileDataIDs (SFID): num_skin_profiles view entries, then the LOD-band skins.

public Vector<uint> SkinFdids { get; }

Property Value

Vector<uint>

TextureAc

Texture transform flags (TXAC), one 2-byte record per material then per particle emitter.

public Vector<FixedArray<byte>> TextureAc { get; }

Property Value

Vector<FixedArray<byte>>

TextureFdids

Texture FileDataIDs (TXID), replacing the in-image texture filenames, one per texture.

public Vector<uint> TextureFdids { get; }

Property Value

Vector<uint>

WaterfallV1

Waterfall render path v1 (WFV1); undocumented, kept verbatim.

public ChunkBlob WaterfallV1 { get; set; }

Property Value

ChunkBlob

WaterfallV2

Waterfall render path v2 (WFV2); undocumented, kept verbatim.

public ChunkBlob WaterfallV2 { get; set; }

Property Value

ChunkBlob

WaterfallV3

Waterfall render path v3 (WFV3); shader parameter block, kept verbatim.

public ChunkBlob WaterfallV3 { get; set; }

Property Value

ChunkBlob

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()

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

ForVersion(ClientVersion)

A fresh M2ChunkedFile 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 M2ChunkedFile ForVersion(ClientVersion version)

Parameters

version ClientVersion

Returns

M2ChunkedFile

ForVersion(Expansion)

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

public static M2ChunkedFile ForVersion(Expansion era)

Parameters

era Expansion

Returns

M2ChunkedFile

GetHashCode()

Reference-identity hash (the C++ type has no hash to mirror).

public override int GetHashCode()

Returns

int

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[]

Operators

operator ==(M2ChunkedFile?, M2ChunkedFile?)

public static bool operator ==(M2ChunkedFile? l, M2ChunkedFile? r)

Parameters

l M2ChunkedFile
r M2ChunkedFile

Returns

bool

operator !=(M2ChunkedFile?, M2ChunkedFile?)

public static bool operator !=(M2ChunkedFile? l, M2ChunkedFile? r)

Parameters

l M2ChunkedFile
r M2ChunkedFile

Returns

bool