M2 Files

M2 files are 3D model files used for smaller and animated models in the game, such as items, creatures, spells, players and smaller world props and houses.

M2 is a complex file format even when using editors like WBS, and this article does not aim to explain them fully. A proper technical outline of the M2 binary file format can be found on the wowdev wiki

Overview

M2 files consists of various properties that define how they look:

  • Geometry: The mesh data that makes up the model
    • Vertices: ‘Points’ that make up the edges of the model.
      • Location: The point in the models local 3D space where this vertex is located.
      • UV coordinates: Defines what part of a texture should be connected to this vertex when rendered.
    • Triangles: Defines what vertices should be connected to form a visible face of geometry. Triangles are the only geometric primitives supported by the game.
      • Vertex indices: 3 indices to vertices that form this triangle.
      • Texture index: Defines what Texture this triangle uses.
      • Material index: Defines what Material this triangle uses.
  • Bones: Specific points in the model that can be used by animations to move mesh data around
    • Billboards: Some bones have special billboard settings for displaying small images that always face the viewer.
    • Rotation, movement and scale Can be animated in Animation Tracks
  • Colors: Values that can be used to tint the entire model
    • Can be animated in Animation Tracks
  • Transparency:
    • Can be animated in Animation Tracks
  • Textures: Used to define what textures are displayed on the model
    • Specific texture entries are connected to individual triangles in the files geometry data.
    • There are a large amount of different types of textures that can be attached to an M2 model, but some of the most important ones include:
      • Hardcoded: A literal path to a blp file that should always be
      • Skin: Used for creatures with different color variations
      • Hair: Used for character hair
      • Clothing: Used on character models where clothing can be applied by items.
  • Texture Animations: Used to move textures around on the model
    • Can be animated in Animation Tracks
  • Collision: Special geometry used for collision boundary checks.

  • Attachments: Special parts of the models where things like helmets, shoulderpads, gloves, weapons or boots can be attached.

  • Events: Special procedures that are called when certain animations play, primarily used to play footstep or death sounds.
  • Materials: Used to define special shader settings for triangles, like what blending modes they should use and how they should be affected by lighting.

  • Lights: Parts of the model that can light up the geometry of the model itself, and to a limited extend the geometry around it in the world.
    • Can be animated in Animation Tracks
  • Cameras: Points in the model used for displaying the model in portraits.

  • Particles: Parts of the model that can be used to emit particles
    • Can be animated in Animation Tracks
  • Ribbons: Special particle emitters commonly used for things like leaving trails behind weapons or spells.
    • Can be animated in Animation Tracks

Animations

M2 files support animations using two concepts:

  • Animation Definitions: These are sequences of behavior that the client can cause a model to execute. For example, walk is an animation, as is stand and attack with a 1h weapon.
    • This part of the model does not contain any actual animated data, as such data is tied to speific components using Animation Tracks.
    • Global Sequences: Some animations are not caused by specific events in the client, but always play for as long as the model is visible. Such animations are known as “Global Sequences”.
  • Animation Tracks: Parts of various M2 components that can have their behavior animated and tied to specific animation IDs. For example, bones can have animation tracks tied to a models attack with a 1h weapon animation, causing the bones in the body to move in a manner that makes the model hit something in front of them.

Skin Files

Skin files are parts of M2 files that can be used to store Level of Detail (LOD) data for models. Contrary to what some beginners believe, skin files do not contain different texture variation for creatures.

All M2 files have at least one .skin file in WoTLK, and that file is not optional.

Most model editors available do not handle more than a single .skin file, and do not produce more than one for each model.

Editing M2 Files

M2 files can be edited using a large amount of different editors under the tools section of this website.