Overview

This page lists all .MSH file chunks. In the .MSH file these chunks are organized in a hierarchy with HEDR (header) being the first chunk and branching out from there (as visualized in the sidebar navigation).

Some of these chunks are exclusive to certain versions of the engine (Star Wars: The Clone Wars and before, Star Wars: Battlefront and Star Wars: Battlefront II) or deprecated completely. Most notably Cloth Simulation (CLTH and children) being limited to Star Wars: Battlefront II.

ExampleChunk

Description

This is an example chunk.

Parent Children Necessity
PARENT CHUNK ALL POSSIBLE CHILDREN Number of appearances or if it's optional.

See also:   A list of links for further reading.   

Structure

Data Type Size (bytes) Description
byte[4] 4 Header/chunk name. Every chunk has this.
long int 4 Length indicator. Stores the length in bytes excluding the header and the size indicator. Every chunk has this indicator.
~ The rest of the data.
HEDR

Description

.msh file header.

Parent Children Necessity
- SHVO MSH2 BLN2 SKL2 ANM2 CL1L Once.
SHVO

Description

Indicates a shadow volume.

Parent Children Necessity
HEDR - Optional.

Structure

Data Type Size (bytes) Description
long int 4 0 or 1 (if .msh has a shadow volume).
MSH2

Description

.msh file mesh header.

Parent Children Necessity
HEDR SINF CAMR MATL MODL Once
FINF

Description

Possibly deprecated. File information. PROJ: project name. USER: user name. TIME: time.

Parent Children Necessity
MSH2 PROJ USER TIME Once.

Structure

Data Type Size (bytes) Description
ASCII string 4 * X File information.
SINF

Description

Scene information header.

Parent Children Necessity
MSH2 NAME FRAM BBOX Optional.
FRAM

Description

Scene frame information.

Parent Children Necessity
SINF - Optional.

Structure

Data Type Size (bytes) Description
long int 4 Start of frame range.
long int 4 End of frame range.
float 4 Frames per second (usually ~30).
CAMR

Description

Scene camera header.

Parent Children Necessity
MSH2 NAME DATA Optional.
MATL

Description

Material list header.

Parent Children Necessity
MSH2 MATD Once.

Structure

Data Type Size (bytes) Description
long int 4 Count of materials (MATD) in this list.
MATD

Description

Material header.

Parent Children Necessity
MATL NAME MATD.DATA ATRB TX0D One or more.
MATD.DATA

Description

Material colors and specular sharpness (gloss). Colors are stored in 0-1 range.

Parent Children Necessity
MATD - Once.

Structure

Data Type Size (bytes) Description
float [4] 16 Diffuse RGBA color.
float [4] 16 Specular RGBA color.
float [4] 16 Ambient RGBA color.
float 4 Specular sharpness (gloss).
ATRB

Description

Material flags (glow and other special rendertypes).

Parent Children Necessity
MATD - Once.

See also:   ZeroEngine Render Types   Inside Edit Flags (GT)   GameToast ATRB discussion   Flag Calculator   

Structure

Data Type Size (bytes) Description
byte 1 Sum of all flag values.
byte 1 Render Type number.
byte 1 Data0 Value. Range: 0-255
byte 1 Data1 Value. Range: 0-255

Flags

Value Flag Description
1 Emissive Emissive material (unlit).
2 Glow Simple glow.
4 Single-sided Transparency Can't be used with Double-sided Transparency.
8 Double-sided Transparency Can't be used with Single-sided Transparency.
16 Hard-edged Transparency Pixels are either opaque (>128/50%) or transparent (<129).
32 Per-Pixel Lighting More expensive and better looking lighting method (default is Per-Vertex Lighting).
64 Additive Transparency Performs an Add instead of a Blend when multiple transparent surfaces overlap.
128 Specular Controlled by specular color and decay (gloss) in the material. Optional alpha channel in the diffuse texture acts as gloss map.
TX0D

Description

Texture name with extension (not full path). For multiple textures the name of the chunk will change to TX1D, TX2D, TX3D.

Parent Children Necessity
MATD - Optional.

Structure

Data Type Size (bytes) Description
ASCII string ~ Texture name.
PRFX

Description

Possibly deprecated. Material prefix.

Parent Children Necessity
MATD - Once.

Structure

Data Type Size (bytes) Description
ASCII string 4 * X Prefix.
MODL

Description

Model header.

Parent Children Necessity
MSH2 NAME MTYP MNDX PRNT FLGS TRAN GEOM SWCI One or more.
MTYP

Description

Model type.

Parent Children Necessity
MODL - Once.

Structure

Data Type Size (bytes) Description
long int 4 Model type.

Model Types

Value Type
0 Null.
1 Dynamic mesh (weighted/enveloped).
2 Cloth.
3 Bone.
4 Static mesh.
6 Shadow mesh.
MNDX

Description

0-based Model index.

Parent Children Necessity
MODL - Once.

Structure

Data Type Size (bytes) Description
long int 4 Model index.
PRNT

Description

Name of the parent model, padded with 00's to fill up to a multiple-of-4 size.

Parent Children Necessity
MODL - Optional.

Structure

Data Type Size (bytes) Description
ASCII string ~ Parent model name.
FLGS

Description

Model display flags.

Parent Children Necessity
MODL - Once.

Structure

Data Type Size (bytes) Description
long int 4 Render Flags.

Render Flags

Value Flag
1 Hidden.
2 Dynamically lit.
4 Retain normals.
8 Render after shadows.
16 Don't flatten geometry.
32 PS2 optimize.
TRAN

Description

Matrix transform. Scale can get ignored in-game.

Parent Children Necessity
MODL - Once.

Structure

Data Type Size (bytes) Description
float [3] 12 Scale factor in XYZ.
float [4] 16 Quaternion Rotation in XYZW.
float [3] 12 Translation in XYZ.
SWCI

Description

Collision primitive.

Parent Children Necessity
MODL - Optional.

Structure

Data Type Size (bytes) Description
long int 4 Primitive type (0: sphere, 1: sphere, 2: cylinder, 4: cube).
float 4 Data (sphere: radius, cylinder: radius, cube: x_length.
float 4 Data (sphere: -, cylinder: height, cube: y_length.
float 4 Data (sphere: -, cylinder: -, cube: z_length.
GEOM

Description

Geometry header. Will be used for static/dynamic geometry and shadow volumes.

Parent Children Necessity
MODL BBOX SEGM CLTH ENVL Optional (depends on model type).
ENVL

Description

List of indices into MODL. This model is enveloped to those indices' models.

Parent Children Necessity
GEOM - Optional.

Structure

Data Type Size (bytes) Description
long int 4 Number of indices into MODL.
long int [] 4 each Index into MODL.
SEGM

Description

Geometry segment header.

Parent Children Necessity
GEOM SHDW MATI POSL CLRL CLRB WGHT NRML UV0L NDXL NDXT STRP One or more.
SHDW

Description

Shadow mesh geometry.

Parent Children Necessity
SEGM - If the model is a shadow mesh, once.

Structure

Data Type Size (bytes) Description
long int 4 Number of vertex positions.
float [3][] 12 each Vertex positions (XYZ).
long int 4 Number of edges.
short int [4][] 8 each Edge. The following 4 entries form one edge.
> short int 2 Vertex index of this edge entry. Refers to the vertex list above.
> short int 2 Reference into an edge. Defines the target vertex (the local edge vertex of the referenced edge) to which the edge should be dran from the local vertex.
> short int 2 Second reference into an edge. In all example .msh files I've seen this always refers to the same vertex as the first edge reference.
> short int 2 MAX_VALUE of short integers (65535). Indicates the end of this edge.
MATI

Description

Material index (index into MATL).

Parent Children Necessity
SEGM - Once?

Structure

Data Type Size (bytes) Description
long int 4 Material index.
POSL

Description

List of vertex coordinates.

Parent Children Necessity
SEGM - Once (unless shadow mesh).

Structure

Data Type Size (bytes) Description
long int 4 Number of coordinates stored in this list.
float [3][] 12 each XYZ coordinates for each vertex.
NRML

Description

List of normals.

Parent Children Necessity
SEGM - Once (unless shadow mesh).

Structure

Data Type Size (bytes) Description
long int 4 Number of normal vectors stored in this list.
float [3][] 12 each UVW vector for each vertex.
UV0L

Description

List of UV coordinates.

Parent Children Necessity
SEGM - Optional.

Structure

Data Type Size (bytes) Description
long int 4 Number of UV coordinates stored in this list.
float [2][] 8 each UV coordinate for each vertex.
CLRL

Description

List of vertex colors.

Parent Children Necessity
SEGM - Optional.

Structure

Data Type Size (bytes) Description
long int 4 Number of colors stored in this list.
byte [4][] 4 each RGBA color (0-255).
CLRB

Description

One vertex color for the whole segment.

Parent Children Necessity
SEGM - Optional.

Structure

Data Type Size (bytes) Description
byte [4] 4 RGBA color (0-255).
WGHT

Description

List of bone-weight percentage pairs. Always 4 pairs per vertex.

Parent Children Necessity
SEGM - Optional.

Structure

Data Type Size (bytes) Description
long int 4 Number of bone weights stored in this list.
The following appears 4 times per vertex (to allow for soft weighting).
long int 4 Index into ENVL (which then indexes into MODL).
float 4 Weight value (0-1).
NDXL

Description

Polygons.

Parent Children Necessity
SEGM - Optional/deprecated.
NDXT

Description

Triangles.

Parent Children Necessity
SEGM - Optional/deprecated.
STRP

Description

List of triangles strips. The start of a strip is indicated by 2 entries with a high bit set (0x8000 or 32768 added). Triangles are listed CW, CCW, CW, CCW... NOTE: In some meshes this chunk has a trailing short which is not calculated into the length/size of this chunk or the # of indices. This short can be ignored. If added to the last polygon it will break it as it always seems to be 0.

Parent Children Necessity
SEGM NAME FRAM BBOX Once (unless shadow mesh).

Structure

Data Type Size (bytes) Description
long int 4 Number of indices into POSL.
short int [] 2 each Index into POSL. The indices will form polygons.
VLTB

Description

Possibly deprecated. Baked vertex light.

Parent Children Necessity
SEGM - Optional.

Structure

Data Type Size (bytes) Description
byte 1 Red.
byte 1 Green.
byte 1 Blue.
byte 1 Alpha.
VLTL

Description

Possibly deprecated. Unique baked vertex lights for vertices.

Parent Children Necessity
SEGM - Optional.

Structure

Data Type Size (bytes) Description
long int 4 Number of colors to come.
byte 1 Red.
byte 1 Green.
byte 1 Blue.
byte 1 Alpha.
CLTH

Description

Cloth header. Replaces SEGM.

Parent Children Necessity
GEOM CTEXT CPOS CUV0 FIDX FWGT CMSH SPRS CPRS BPRS COLL Optional.
CTEX

Description

Texture name with extension.

Parent Children Necessity
CLTH - Once.

Structure

Data Type Size (bytes) Description
ASCII string ~ Texture name.
CPOS

Description

List of vertex coordinates.

Parent Children Necessity
CLTH - Once.

Structure

Data Type Size (bytes) Description
long int 4 Number of vertex positions.
float [3][] 12 each XYZ coordinates.
CUV0

Description

List of UV coordinates.

Parent Children Necessity
CLTH - Optional?

Structure

Data Type Size (bytes) Description
long int 4 Number of UV coordinates.
float [2][] 8 each UV coordinate.
FIDX

Description

List of fixed points.

Parent Children Necessity
CLTH - Optional?

Structure

Data Type Size (bytes) Description
long int 4 Number of points.
long int ] 4 each Index into CPOS.
FWGT

Description

Index of FIDX weighted to a bone by name.

Parent Children Necessity
CLTH - Optional?

Structure

Data Type Size (bytes) Description
long int 4 Number of points.
ASCII string ~ Name of the bone the corresponding FIDX is moving with.
CMSH

Description

Cloth triangles.

Parent Children Necessity
CLTH - Once.

Structure

Data Type Size (bytes) Description
long int 4 Number of points.
long int [3][] 16 each Triangle points defined CCW.
SPRS

Description

Stretch constraint data. Keeps cloth size by storing relations between points (like edges around a quad).

Parent Children Necessity
CLTH - Optional?

See also:   Constraint discussion (GT)   

Structure

Data Type Size (bytes) Description
long int 4 Number of items.
short int [2][] 4 each Two points sharing an edge.
CPRS

Description

Cross constraint data. Keeps individual pieces of the cloth from shearing (cross relations between points). Think of the edges as sticky tape, glueing the points together.

Parent Children Necessity
CLTH - Optional?

See also:   Constraint discussion (GT)   

Structure

Data Type Size (bytes) Description
long int 4 Number of items.
short int [2][] 4 each Two points sharing a quad.
BPRS

Description

Bend constraint data. Keeps the cloth's shape (relations between border-points of the cloth mesh, disables bending along those edges).

Parent Children Necessity
CLTH - Optional?

See also:   Constraint discussion (GT)   

Structure

Data Type Size (bytes) Description
long int 4 Number of items.
short int [2][] 4 each Two border-points sharing a 'straight' edge over the complete cloth.
COLL

Description

Cloth collision. Note that this chunk is padded with 00's until it has a multiple of 4 chunk size.

Parent Children Necessity
CLTH - Optional?

Structure

Data Type Size (bytes) Description
long int 4 Number of collisions.
ASCII string ~ Collision object name.
ASCII string ~ Object name this collision moves with.
long int 4 Primitive type (0: sphere, 1: cylinder, 2: cube).
float 4 Data (sphere: radius, cylinder: radius, cube: x_length / 2).
float 4 Data (sphere: radius, cylinder: height, cube: y_length / 2).
float 4 Data (sphere: radius, cylinder: -, cube: z_length / 2).
SKL2

Description

Skeleton/chain. Lists some bone properties for every item in the chain. The values don't seem to make a big difference.

Parent Children Necessity
HEDR - Optional.

Structure

Data Type Size (bytes) Description
long int 4 Number of bones in this skeleton.
CRC checksum 4 CRC checksum of the bone.
long int 4 Type (bone?). Usual value: 0.
float 4 Constrain. Usual value: -1 or 1.
float 4 Bone length 1. Usual value: 0.
float 4 Bone length 2. Usual value: 0.
BLN2

Description

Blend factors for the chain items (bones). Purpose unknown. Blend factor usually is 0/nothing (if float).

Parent Children Necessity
HEDR - Optional.

Structure

Data Type Size (bytes) Description
long int 4 Number of bones.
CRC checksum 4 CRC checksum of the bone.
? 4 Blend factor. Usual value: 0.
ANM2

Description

Animation header.

Parent Children Necessity
HEDR CYCL KFR3 Optional.
CYCL

Description

Animation cycles. Can contain multiple animations.

Parent Children Necessity
ANM2 - Once.

Structure

Data Type Size (bytes) Description
long int 4 Number of animations.
The following can appear multiple times.
ASCII string 64 Aimation name.
float 4 Frame rate.
long int 4 Play Style.
long int 4 First frame.
long int 4 Last frame.
KFR3

Description

All the frames and their local translation and rotation. Frame indices don't have to be consecutive. They can skip frames (like keyframes).

Parent Children Necessity
ANM2 - Once.

Structure

Data Type Size (bytes) Description
long int 4 Number of bones in this animation.
The following will appear once per chain item.
> CRC checksum 4 CRC checksum.
> long int 4 Keyframe type.
> long int 4 Number of translation frames.
> long int 4 Number of rotation frames.
Translation frames will be listed first.
>> long int 4 Translation frame index.
>> float [3][] 12 Translation in XYZ.
Rotation frames will be listed second.
>> long int 4 Rotation frame index.
>> float [4][] 16 Quaternion rotation in XYZW.
NAME

Description

Name, padded with 00's to fill up a multiple-of-4 size.

Parent Children Necessity
- - Once.

Structure

Data Type Size (bytes) Description
ASCII string 4 * X Name.
BBOX

Description

Bounding box. SINF's BBox will determine the blue/green selection box in ZeroEdit.

Parent Children Necessity
- - Once.

Structure

Data Type Size (bytes) Description
float [4] 16 Quaternion Rotation in XYZW.
float [3] 12 Center of the BBox.
float [3] 12 Extents of the BBox (width/2, height/2, depth/2).
float 4 Bounding sphere radius.
LGTP

Description

Possibly deprecated. Point Light.

Parent Children Necessity
- PRFX NAME DATA Optional.

Structure

Data Type Size (bytes) Description
float 4 Red.
float 4 Green.
float 4 Blue.
float 4 Alpha.
float 4 X.
float 4 Y.
float 4 Z.
float 4 Falloff start.
float 4 Falloff end.
long int 4 Flags (1: CastShadows).
LGTI

Description

Possibly deprecated. Infinite Light.

Parent Children Necessity
- PRFX NAME DATA Optional.

Structure

Data Type Size (bytes) Description
float 4 Red.
float 4 Green.
float 4 Blue.
float 4 Alpha.
float 4 X.
float 4 Y.
float 4 Z.
float 4 Falloff start.
float 4 Falloff end.
long int 4 Flags (1: CastShadows).
LGTS

Description

Possibly deprecated. Spot Light.

Parent Children Necessity
- PRFX NAME DATA Optional.

Structure

Data Type Size (bytes) Description
float 4 Red.
float 4 Green.
float 4 Blue.
float 4 Alpha.
float 4 X.
float 4 Y.
float 4 Z.
float 4 Interest X.
float 4 Interest Y.
float 4 Interest Z.
float 4 Falloff start.
float 4 Falloff end.
float 4 Cone Angle.
float 4 Spread Angle.
long int 4 Flags (1: CastShadows).
FOGD

Description

Possibly deprecated. Fog data.

Parent Children Necessity
- - Optional.

Structure

Data Type Size (bytes) Description
float 4 Red.
float 4 Green.
float 4 Blue.
float 4 Alpha.
float 4 Near plane.
float 4 Far plane.