Thanks a lot for finding these bugs. I now have enough material to spend some debugging time on (y).
The crash is probably because of a buggy CAS model header. I'll see what I can do to get the models working.
EDIT: Good news, fixed the model export crash (at least it works for me). I had a bug in the C++ code, which caused me to write a CAS model header constant twice - apparently RTW indeed does use the header data for something...
I'm working on version 0.86b right now, but if you want a quick fix, replace the MAXScript CASHEADER Write function at line 113 with this:
Code:
fn Write fp =
(
WriteFloat fp 3.18 -- filever
WriteLong fp 38 -- cas chunkSize
WriteLong fp 9 -- cas chunkType (9 == cas model header)
WriteLong fp 0 -- ?
WriteFloat fp 3.3333 -- ?
WriteLong fp 1 -- ?
WriteLong fp 0 -- ?
WriteByte fp 104 -- ?
WriteByte fp 104 -- ?
WriteByte fp 104 -- ?
WriteByte fp 1 -- ?
WriteShort fp 0 -- ?
WriteLong fp 0 -- ?
WriteLong fp 0 -- ?
--// 42 bytes written
)
I have no idea what those 4 bytes represent, but it seems to vary from model type to model type. Perhaps it's an internal ID of what the model is used for. Newer ALEX models use 94, 94, 94, 1 (hex 5E 5E 5E 01 and little endian int hex 015e5e5e).
I know that spot FX and INFO files have different data there. I guess our best bet would run the C++ program on a huge number of .CAS files and do some data-mining. Perhaps we can categorize models by it...
I'll make a new post later if I have a breakthrough. Right now I'm working on hameleona's models.