Summer Update 2004 and Mesh/Skinmesh loading

Started by
4 comments, last by yzzid 19 years, 8 months ago
Greetings. I recently updated to the 2004 Summer Update for DirectX and started writing a class to load skinmeshes, but I've run into an interesting problem. After I had followed the examples (including one in Jim's RPG book) and working out the interface changes between DX 8 and 9 I tested my code up until the point where it calls D3DXLoadSkinMeshFromXof but it crashes with an access violation. At first I suspected that I had made an error somewhere along the line, so I checked all my vars etc, and the parameters I was passing in, but they are all fine. So then I checked the way I was iterating through the frame hierarchy by comparing to the new DXUTMeshFile class included in the Sample Framework and it's pretty much the same process. So I am happy there's no problem there. So then I tried several other meshes included with the SDK (the plane, I was using tiny.x originally) but the same problem occured. So I ruled out an incompatibility between the files. So then I tried the actual DXUTMeshFile class, no dice! It fails at the exact same spot, the point where it finds a TID_D3DRMMesh and attempts to load it with D3DXLoadMeshFromX - I know it's not the same call as D3DXLoadSkinMeshFromXof -but- this class failed loading the plane mesh and the tiny.x mesh (both on the first call to D3DXLoadMeshFromX). Then I tried all this again within the Skinmesh sample application, just to make sure. My question is, is anyone having similar problems? I know that's pretty broad, but I am curious. What I thinking of doing now is just using the code from the Skinmesh example to build my class (my current class is built using a process similar to that described in Jim's book and one of the articles on this site). It's actually pretty easy but it says it collapses all meshes into one, but that might not be a problem. But I'll also need to compile the latest exporter from the SDK using max (why isn't an update pre-compile binary included?) Anyway, thanks for reading all this way! :)
Advertisement
Access violations usually mean you are trying to use memory that was not allocated. Are you sure all the parameters you are passing are valid? That is the first thing I would check.
-dizzyGame Institute InternPlease rate me. :)
Hi. Yep, that's the first thing I did check! :) They are all valid. For D3DXLoadSkinMeshFromXof the first three parameters are are data you pass in (the LPD3DXFILEDATA, option flags and a pointer to the device) the rest are all out pointers.

I think I forgot to mention that when I test the DXUTMeshFile class within the skinmesh example I think it gave me an illegal operation error rather than the access violation.

Thanks again.
From the call stack I assume it crashed at the point (within the call to D3DXLoadSkinMeshFromXof) where it calls D3DXLoadMeshFromXofEx, it then goes on to create the mesh for return within the supplied parameter. Unfortunately, it never managers to succeed. Rather weird.
Argh! I fixed it, what a stupid error to make. Nope, I don't want to talk about it, except to say don't code at 3am in the morning after a long day (why -do- I still do that? :P).

Sorry for clogging up the boards. ;)
No problems.

Just glad you could fix the problem.
It is always makes me feel better to find it and fix it myself than have someone else find a simple mistake. Consider yourself lucky this time. ;)
-dizzyGame Institute InternPlease rate me. :)

This topic is closed to new replies.

Advertisement