My MSH Chunk Tool progress
Posted: Thu Nov 12, 2009 9:53 pm
I need some way to keep track of all the information I discover and need, and what better way for all than to make it public?
MSH Chunk Tool will be an easy-to-use utility for transferring MODL chunks from one MSH to another without the need of a hex editor, and will be able to do so with much more efficiency and capability than a hex editor. Someone has also requested that I make a better MSH exporter. I may also use this information later to do this also. Comment as you please. I am using http://personal.riley-man.com/swbf/edit ... f-msh.html and a hex editor to gather a complete summary of the msh file format.
Done:
Mesh Loading (would like to know what the ENVL section actually does, though)
Prototype user interface
.msh File format; for the moment, this is all the info I need.
"HEDR" (4 bytes, indicates header)
- Integer (4 bytes, add 8 to this number and you get file size)
"MSH2" (4 bytes, indicates start of mesh information)
- Integer (4 bytes, add 16 to this number and you get file size)
"SINF" (4 bytes, header for info used only by ZeroEditor)
- Integer (4 bytes, Length in bytes of following section = 76 + length of Text under NAME heading)
- "NAME" (4 byte header)
- - Integer (4 bytes, indicates length of section)
- - Text (Zero-terminated string, does not seem to hold any real purpose)
- "FRAM"
- - Integer (4 bytes, should always be 12)
- - Two Integers (4 bytes each, appear to be 1 and 100 for an object and 0 and 1 for a player model)
- - One Integer (4 bytes, seems to always be 1106231967)
- "BBOX" (4 byte header data for bounding box)
- - Integer (4 bytes, should always be 44)
- - 44 Bytes of data - 11 Integers (I will have to see what to do with this. I don't know how this part works)
"CAMR" (4 byte header for camera information)
- Integer (4 bytes, length of following section = 52 + length of NAME text)
- "NAME" (4 byte header)
- - Integer (4 bytes, indicates length of section)
- - Text (Zero-terminated string, no remarkable purpose)
- "DATA" (4 byte header for the actual camera info)
- - Integer (4 bytes, should always be 40)
- - 10 Integers (Likely store information on camera position and orientation)
"MATL" (4 byte header outlining textures (materials) used for the model)
- Integer (4 bytes, size in bytes of following section, total is a bit more complex due to numerous strings and a variable quantity of MATD headings)
- Integer (4 bytes, indicates number of MATD headings)
"MATD" (4 byte header. There can be more than one of these)
- Integer (4 bytes, length in bytes of following information)
- "NAME"
- - Integer (4 bytes, indicates length of section)
- - Text (Zero-terminated string, name of material, but NOT name of the targa file)
- "DATA"
- - Integer (4 bytes, should always be 52)
- - 13 Integers (Contains miscellaneous information on the texture)
- "ATRB"
- - Integer (4 bytes, should always be 4)
- - Integer (4 bytes, usually 0 for player models. Supposedly set Material Attribute. I noted that the dark trooper's value here for both materials is 1024, and its lowres is 0. 0 appears to probably be no special attribute)
- "TX0D" (4 bytes, it is TX [zero] D, NOT TX [letter O] D. I read that not all materials have this)
- - Integer (4 bytes, shows length of section)
- - Text (Zero-terminated string, file name of targa texture for material)
"MODL" (4 byte header, there will usually be a considerable number of these. There should, for player models, be a dummyroot and a boneroot at the minimum)
- Integer (4 bytes, indicates length of MODL section)
- "MTYP"
- - Integer (4 bytes, should always be 4)
- - Integer (4 bytes, sets MODL type: null, skin, envelope, static, or shadow)
- "MNDX"
- - Integer (4 bytes, should always be 4)
- - Integer (4 bytes, what number the chunk is as appears in the file - first, second, third, etc.)
- "NAME"
- - Integer (4 bytes, indicates length of section)
- - Text (Zero-terminated string, name of chunk. Usually acceptably descriptive.)
- "PRNT" (4 byte header, used to set a model's parent, is optional)
- - Integer (4 bytes, length of section)
- - Text (Zero-terminated string, name of parent MODL. DummyRoot does not typically have a parent.)
- "FLGS" (4 byte header, used for child flags, optional)
- - Integer (4 bytes, should always be 4)
- - Integer (4 bytes, all the values I observed were 1)
- "TRAN"
- - 44 Bytes of data which I will not touch on at this point
- "GEOM"
- - Integer (4 bytes, length of section in bytes)
- - "BBOX"
- - - 48 Bytes of data to ignore at the moment
- - "SEGM" (4 byte header, this is where all the model data is stored)
- - - Integer (4 bytes, length of section in bytes)
- - - "MATI"
- - - - Integer (4 bytes, should always be 4)
- - - - Integer (4 bytes, index of material to use)
- - - [ Length of SEGM section - 12 = quantity of bytes for model info ]
- "ENVL" (4 byte header, probably used for stuff that has to do with the skeleton)
- - Integer (4 bytes, length of section, tends to vary)
- - Section (length is indicated by above integer.)
"CL1L" (4 byte header, seems to be at the end of every mesh file)
- Integer (4 bytes, I have not observed it as equalling anything but 0)
MSH Chunk Tool will be an easy-to-use utility for transferring MODL chunks from one MSH to another without the need of a hex editor, and will be able to do so with much more efficiency and capability than a hex editor. Someone has also requested that I make a better MSH exporter. I may also use this information later to do this also. Comment as you please. I am using http://personal.riley-man.com/swbf/edit ... f-msh.html and a hex editor to gather a complete summary of the msh file format.
Done:
Mesh Loading (would like to know what the ENVL section actually does, though)
Prototype user interface
.msh File format; for the moment, this is all the info I need.
"HEDR" (4 bytes, indicates header)
- Integer (4 bytes, add 8 to this number and you get file size)
"MSH2" (4 bytes, indicates start of mesh information)
- Integer (4 bytes, add 16 to this number and you get file size)
"SINF" (4 bytes, header for info used only by ZeroEditor)
- Integer (4 bytes, Length in bytes of following section = 76 + length of Text under NAME heading)
- "NAME" (4 byte header)
- - Integer (4 bytes, indicates length of section)
- - Text (Zero-terminated string, does not seem to hold any real purpose)
- "FRAM"
- - Integer (4 bytes, should always be 12)
- - Two Integers (4 bytes each, appear to be 1 and 100 for an object and 0 and 1 for a player model)
- - One Integer (4 bytes, seems to always be 1106231967)
- "BBOX" (4 byte header data for bounding box)
- - Integer (4 bytes, should always be 44)
- - 44 Bytes of data - 11 Integers (I will have to see what to do with this. I don't know how this part works)
"CAMR" (4 byte header for camera information)
- Integer (4 bytes, length of following section = 52 + length of NAME text)
- "NAME" (4 byte header)
- - Integer (4 bytes, indicates length of section)
- - Text (Zero-terminated string, no remarkable purpose)
- "DATA" (4 byte header for the actual camera info)
- - Integer (4 bytes, should always be 40)
- - 10 Integers (Likely store information on camera position and orientation)
"MATL" (4 byte header outlining textures (materials) used for the model)
- Integer (4 bytes, size in bytes of following section, total is a bit more complex due to numerous strings and a variable quantity of MATD headings)
- Integer (4 bytes, indicates number of MATD headings)
"MATD" (4 byte header. There can be more than one of these)
- Integer (4 bytes, length in bytes of following information)
- "NAME"
- - Integer (4 bytes, indicates length of section)
- - Text (Zero-terminated string, name of material, but NOT name of the targa file)
- "DATA"
- - Integer (4 bytes, should always be 52)
- - 13 Integers (Contains miscellaneous information on the texture)
- "ATRB"
- - Integer (4 bytes, should always be 4)
- - Integer (4 bytes, usually 0 for player models. Supposedly set Material Attribute. I noted that the dark trooper's value here for both materials is 1024, and its lowres is 0. 0 appears to probably be no special attribute)
- "TX0D" (4 bytes, it is TX [zero] D, NOT TX [letter O] D. I read that not all materials have this)
- - Integer (4 bytes, shows length of section)
- - Text (Zero-terminated string, file name of targa texture for material)
"MODL" (4 byte header, there will usually be a considerable number of these. There should, for player models, be a dummyroot and a boneroot at the minimum)
- Integer (4 bytes, indicates length of MODL section)
- "MTYP"
- - Integer (4 bytes, should always be 4)
- - Integer (4 bytes, sets MODL type: null, skin, envelope, static, or shadow)
- "MNDX"
- - Integer (4 bytes, should always be 4)
- - Integer (4 bytes, what number the chunk is as appears in the file - first, second, third, etc.)
- "NAME"
- - Integer (4 bytes, indicates length of section)
- - Text (Zero-terminated string, name of chunk. Usually acceptably descriptive.)
- "PRNT" (4 byte header, used to set a model's parent, is optional)
- - Integer (4 bytes, length of section)
- - Text (Zero-terminated string, name of parent MODL. DummyRoot does not typically have a parent.)
- "FLGS" (4 byte header, used for child flags, optional)
- - Integer (4 bytes, should always be 4)
- - Integer (4 bytes, all the values I observed were 1)
- "TRAN"
- - 44 Bytes of data which I will not touch on at this point
- "GEOM"
- - Integer (4 bytes, length of section in bytes)
- - "BBOX"
- - - 48 Bytes of data to ignore at the moment
- - "SEGM" (4 byte header, this is where all the model data is stored)
- - - Integer (4 bytes, length of section in bytes)
- - - "MATI"
- - - - Integer (4 bytes, should always be 4)
- - - - Integer (4 bytes, index of material to use)
- - - [ Length of SEGM section - 12 = quantity of bytes for model info ]
- "ENVL" (4 byte header, probably used for stuff that has to do with the skeleton)
- - Integer (4 bytes, length of section, tends to vary)
- - Section (length is indicated by above integer.)
"CL1L" (4 byte header, seems to be at the end of every mesh file)
- Integer (4 bytes, I have not observed it as equalling anything but 0)