Luigi's Mansion:Docs/Model Formats/MDL (File Format)

From LM Hacking
Jump to navigation Jump to search

Summary[edit | edit source]

MDL files can be partially edited, only through a hex editor. It can be extracted but not imported.

In Luigi Mansion , MDL model files are used for character models, such as Luigi, E. Gadd, and the ghosts.

Format Information[edit | edit source]

Don't confuse the MDL format to be the same as others, as they are different.

Original MDL doc is below the wikitables.

Offset Integer Use Description
0x00 u8 Flag Determines how data is read (98 = Tri-Strips)
0x01 u8 Null Null byte
0x02 u8 Data Total Total Data
0x03 u8 Matrix Index Index of the Bone Matrix
0x04 u8 Index Could be TexCood0 Matrix Index
0x05 u8 Index Could be TexCood1 Matrix Index

Data Structures[edit | edit source]

Offset Integer Use Description
0x00 u16 Vertex Index Index of Vertice for Mesh
0x02 u16 Normal Index Index of Normal for Mesh (if present)
0x04 u16 Color Index Index of Vertex Color for Mesh (if present)
0x06 u16 U Index Index of U Coordinate for TexCoords
0x08 u16 V Index Index of V Coordinate for TexCoords
uint Description
uint8 matrix index
uint8 texcoord0 matrix index?
uint8 texcoord1 matrix index?
uint16 position index
uint16 normal index (only present if the model has normals)
uint16 color index (only present if the model has colors)
uint16 texcoord index (only present if the model has texcoord)
0x00    u8    Flag        //Determines how data is read (98 = Tri-Strips)
0x01    u8    Null        //Null byte
0x02    u8    Data Total    //Total Data
0x03    u8    Matrix Index    //Index of the Bone Matrix
0x04    u8    Index        //Could be TexCood0 Matrix Index
0x05    u8    Index        //Could be TexCood1 Matrix Index

--Data Structures--
0x00    u16    Vertex Index    //Index of Vertice for Mesh

0x02    u16    Normal Index    //Index of Normal for Mesh (if present)

0x04    u16    Color Index    //Index of Vertex Color for Mesh (if present)

0x06    u16    U Index        //Index of U Coordinate for TexCoords
0x08    u16    V Index        //Index of V Coordinate for TexCoords


uint8 - matrix index
uint8 - texcoord0 matrix index?
uint8 - texcoord1 matrix index?
uint16 - position index
uint16 - normal index (only present if the model has normals)
uint16 - color index (only present if the model has colors)
uint16 - texcoord index (only present if the model has texcoords)
(Source: SpaceCats)