Well I've looked vigorously at this again.
And have many results
Code: Select all
typedef struct {
char Signature[4]; //"MOD "
float Test; //always 1.01
char cushion[8]; //Always here
char amnt_objs; //A byte storing how many models
char amnt_bones; //A byte storing how many bones
char ukn[10]; //Unknown data
int bone_ptr; //Pointer to bone data
char cushion2[16]; //more Null cushioning
} Header;
After this every object has a header.
Code: Select all
typedef struct {
short ukn; //unknown short, always 0x180 or 0x280, perhaps two seperate bytes
short verts; //Total amounts of vertices
int ptr; //Pointer to the model data
char cushion[16]; //More cushioning
char ukn2[4]; //Inconsistent float,
float XYZ[3]; //XYZ coords of parent node?
} OBJ;
After this we reach the direct object header.
Code: Select all
typedef struct {
short verts; //same as before, a vert counter
short headers; //odd counter, sometimes there are two headers before data, this counts down how many
char cushion[8]; //more 0 cushioning
int vert_ptr; //vertex pointer
int tex_ptr; //2 floats with a 3rd inconsistent float at this index, assumed UV
int wght_ptr; //weights ptr, 2 shorts that usually add up to 65535
int nrm_ptr; //pointer to 3 bytes of data, obvious normals
int ukn_ptr; //pointer to 2 bytes of data
} PTRS;
I know how much data each pointer holds because you simply take the array size and divide by the vertex amount.
Now I know what some of you may be thinking,
"where's the face data"
That's what I don't understand, there is none.
No possible place anywhere for face data.
I've found repeated Vertices, so I think perhaps they're storing this the same way as SMD.
Or at least something similar.
This goes on until we hit the bone data
Haven't mapped it out yet, but there are matrices with shorts..?
If anyone else wants to take a look be my guest.
I'll be attaching a beta script shortly, it can dump to OBJ or SMD, just by the switch of a function called.
lol, any help would be GREATLY appreciated.
edit:
Sorry it took me so long to get up
well, here is the script.
Modx.zip
Executable and source packaged along side.
Note:
To change to SMD dumping
uncomment line 164 and comment out 163
(it's obvious if you just look)
the source is very messy.
A lot of repetition because of the SMD/OBJ abilities.
Anyway, hope someone can help me out :P.
You do not have the required permissions to view the files attached to this post.