• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Community: Brawl MDL0 file discussion

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
this is prbly my biggest MDL0 discussion thread yet...
but apperently it's needed :/

I've created this thread in hopes to gain more knowledge about MDL0 files

as you all know, I'm building a plugin for my converter... but not everythings known... yet...
here's what I've figured out about the MDL0, and actually gotten converted so far:

Definitions (what do these do??)
Bones (unconverted)
Verts
Normals
Colors (not sure how they're used)
UV's
Materials (figuring)
Shader_Config (figuring)
Objects (face-points almost complete)
Textures (not sure how they're used)
Pallets (not sure how they're used)

other stuff:
nodes (figuring)
weights (unconverted)

anything I may have forgotten

the unconverted stuff is figured out ;)

notes/thoughts:
the shader configurations are read by 48 byte blocks
be sure not to confuse these with actual shaders...
they're only configurations for defining shaders,
the materials contain the info that uses the shaders.
nodes are basically links between bones and objects,
or more like they create an object parent (mesh to bones)
(if an object's nodeID = -1 , read all nodes)
I just don't know if the -1 nodes are useful
I think colors deal with the vertex colors which conflict with the actual material colors
^still lookong into it

if there's any info about mdl0 files anyone would like to know (that I know),
feel free to ask :)

also, I will most likely be multi-posting :glare:
(for those who are obsessed with telling me otherwise)
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
well... here's a little something I've noticed...

these were normally called the "shader instructions",
but I don't believe that to be so...

I believe these are more along the lines of point attributes:

08 50 00 00 5E 05
08 60 00 00 00 03
10 00 00 10
08 00 00 00 15 00
08 70 41 37 70 09
08 80 C8 24 12 09
08 90 04 82 41 20

here's a few things I've noticed:

08 50 00 00 5E 05 = vertex descriptor 1
08 60 00 00 00 03 = vertex descriptor 2

and will's uses the '08 00 00 00 15 00' block

I'm still doing alot of figuring on these...
but I believe these hold the key to the face-points
 

Tcll

Smash Lord
Joined
Jul 10, 2010
Messages
1,780
Location
The Gates of Darkness
NNID
Tcll5850
well... here's a little something I've noticed...

these were normally called the "shader instructions",
but I don't believe that to be so...

I believe these are more along the lines of point attributes:

00 00
08 50 00 00 5E 05
08 60 00 00 00 03
10 00 00 10
08 00 00 00 15 00
08 70 41 37 70 09
08 80 C8 24 12 09
08 90 04 82 41 20

here's a few things I've noticed:

08 50 00 00 5E 05 = vertex descriptor 1
08 60 00 00 00 03 = vertex descriptor 2

and will's uses the '08 00 00 00 15 00' block

I'm still doing alot of figuring on these...
but I believe these hold the key to the face-points
KK
this data looks like it really is face-point attributes...
basically the key to defining the lengths of the facepoints

now I need some good notes on how it works, and how to convert it...

these notes suck:
Code:
vertex position data block {
 0x40 byte header {
  uint32_t length of this block
  int32_t offset to beginning of file (always negative)
  ...
  uint32_t at 0x10:
   index # of block (starts at 0, should be no gaps)
  uint32_t at 0x14: {
   0x01 = positions, has bounding box + zero pad
   0x00 = normals, no bounding box data + zero pad
  }
  ...
  uint16_t at 0x1c: bytes per vertex (0x04 * #components) {
   0x08 = UVs
   0x0c = vertex and normal data
  }
  uint16_t at 0x1e = number of vertices to follow
  0x20 {
  float[6] (bounding box?)
  uint32_t[2] zero
  } (not present for normals)
 } 
 component data follows: #vertices * #components float32
}

vertex array header: {
 0x140 bytes long, almost completely unknown
 u8 @ 0x0e {
  0x14 or 0x54 for u8 datas
  0x5e for u16 datas
 }
 u16 @ 0x1e (vertex count for a position data block) is:
  0x80 for a 4 or 7 byte vertex struct layout
  0xc0 for an 8 byte vertex struct layout
 u16 @ 0x94 = byte length of 3rd component in the struct
  only if @0x1e != 0xc0 and @0x0e != 0x14
}
vertex array data: {
 u8 list type to follow {
  0x00 == stop processing
  0xB8 == points
  0xA8 == lines
  0xB0 == line strip
  0x90 == triangles
  0x98 == triangle strip
  0xA0 == triangle fan
  0x80 == quads
 }
 u16 = #verts to follow
 if (@0x1e in header == 0xc0) {
  u8 position idx
  u8 unknown1
  u16 unknown2
  u8[4] more unknowns
 } else {
  component lengths defined in header (@0x0e, @0x94):
  position idx
  (uv or normal idx)
  (uv or normal idx)
 }
}
and Pharrox's notes arn't really much help in that area :/

here's that hex as it would be viewed in a hex editor: (padding included)
00 00 00 00 00 00 00 00 00 00 08 50 00 00 5E 05
08 60 00 00 00 03 10 00 00 10 08 00 00 00 15 00
08 70 41 37 70 09 08 80 C8 24 12 09 08 90 04 82
41 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00

^(just in case some people find viewing it this way better) ;P
 

Joako Fargo 1054

Smash Rookie
Joined
Dec 10, 2015
Messages
5
NNID
Cryoshell-ARTPOP
3DS FC
2810-0529-1863
how can i change a .obj model to a .mdl0 model for smash bros. brawl?
 
Top Bottom