View Single Post
Old 03-30-10, 03:31 PM   #171
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by privateer View Post
I'm exporting from Max 9 to a GR2 file.
I've no interest in exporting from the SH5 files at this time.
It's getting a proper import done that is important.
I'm useing the Granny exporter from a link a page or 2 back.
this was done using freely available tools from Microsoft so don't anyone give me any crap about it A .dll file provides services to programs that dynamically link to it during runtime. The way the .dll exposes what 'functionality' it has is through what it makes publicly available defined in exports in the file.

taking a look 'under the hood' of the granny2.dll file shows some interesting items available (exports). There are 1,014 functions available. Here are a few (some had a leading _ which for some reason the post underlined the whole thing):

285 3A 000942E4 GrannyFileInfoType
64 CA 00076A50 _GrannyBeginFile@20
65 CB 00076D00 _GrannyBeginFileCompression@20
66 CC 000766B0 _GrannyBeginFileDataTreeWriting@16
67 CD 00076A80 _GrannyBeginFileInMemory@16
68 CE 00077360 _GrannyBeginLocalPoseAccumulation@16
69 CF 00077E60 _GrannyBeginMesh@20
123 103 00076D30 _GrannyCompressContentsOfFile@12
136 110 000769E0 _GrannyConvertFileInfoToRaw@8
137 111 00076A00 _GrannyConvertFileToRaw@8
138 112 00079680 _GrannyConvertIndices@20
159 127 00077B40 _GrannyCreateMemoryFileReader@8
160 128 00077B60 _GrannyCreateMemoryFileWriter@4
237 149 00076C90 _GrannyDecompressData@32
238 14A 00076CD0 _GrannyDecompressDataChunk@24
256 15A 00076AA0 _GrannyEndFile@8
257 15B 00076D90 _GrannyEndFileCompression@8
258 15C 000766F0 _GrannyEndFileDataTreeWriting@4
259 15D 00076AE0 _GrannyEndFileRaw@8
260 15E 00076B00 _GrannyEndFileRawToWriter@8
261 15F 00076AC0 _GrannyEndFileToWriter@8
459 21C 00077CD0 _GrannyGetMeshBytesPerIndex@4
460 21D 00077CB0 _GrannyGetMeshIndexCount@4
461 21E 00077CE0 _GrannyGetMeshIndices@4
462 21F 00077BA0 _GrannyGetMeshMorphTargetCount@4
463 220 00077C10 _GrannyGetMeshMorphVertexCount@8
464 221 00077BE0 _GrannyGetMeshMorphVertexType@8
465 222 00077C80 _GrannyGetMeshMorphVertices@8
466 223 00077CC0 _GrannyGetMeshTriangleCount@4
467 224 00077BB0 _GrannyGetMeshTriangleGroupCount@4
468 225 00077BC0 _GrannyGetMeshTriangleGroups@4
469 226 00077C00 _GrannyGetMeshVertexCount@4
470 227 00077BD0 _GrannyGetMeshVertexType@4
471 228 00077C70 _GrannyGetMeshVertices@4

Now if you use the granny viewer you'll notice that it gives you information that has to come from these functions. In theory, it should be possible to extract the mesh data and re-import new mesh data into the .gr2 files using the granny2.dll.
I found it interesting that the .gr2 files can be compressed (well it makes sense to save space).
Even more interesting is the _GrannyConvertFileToRaw. If the SH5 files are compressed and we uncompress them then we should be able to 'map' the .gr2 file to undestand it. There is code available that I found on the internet that does uncompress a .gr2 file to an uncompressed format using one of the functions from the granny2.dll file.
Now if you know how to look up what arguments a certain function 'takes' you can write code to use these functions
TheDarkWraith is offline   Reply With Quote