Jump to content
  • Advertisement
Sign in to follow this  
FeanorLobelia

[SlimDX] Skinning questions

This topic is 3879 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm having a few problems porting my shader based skinning onto SlimDX. Although most things from MDX convert perfectly, some things are not identical. For example, I load the hierarchy as I did in MDX, but I get a graphics exception: Dim alloc As New DerivedAllocateHierarchy(Me) ' Load the file rootFrame = Frame.LoadHierarchyFromX(Device, myfile, MeshFlags.Managed, alloc, Nothing, anim) or in C#: { DerivedAllocateHierarchy alloc = new DerivedAllocateHierarchy(this); // Load the file rootFrame = Frame.LoadHierarchyFromX(Device, myfile, MeshFlags.Managed, alloc, null, anim); } anim is the animation controller which had been declared at class level - but set to nothing. alloc is declared there and then - it is a custom AllocateHierarchy. rootFrame is my root frame which is set to nothing also beforehand and declared at class level. Basically, the load hierarchy fails and no frame is output. Has anyone got any ideas?

Share this post


Link to post
Share on other sites
Advertisement
Thanks for responding. I get a NullReferenceException first of all, then a SlimDX.Direct3D9.GraphicsException - I assume the latter is a BadData or BadObject D3DXFERR. Basically, I figure that one of my parameters is null when it shoudn't be and this leads to a G.E. (I get another nullreference when I try to use the frame, but that's the consequence). The problem is that skinning is quite an intricate business.

Share this post


Link to post
Share on other sites
I think I found the problem. It looks like the possibility that the LoadUserData is null is never taken into account, so it tries to access it, which will obviously fail when you pass in a null reference. I'll fix the problem and put it in with my next commit.

Share this post


Link to post
Share on other sites
Sorry to raise this from the dead, but after getting rid of the null exception (and downloading the latest SlimDX build 297, and adapting to the changes) I'm getting a 0xC0000005: Access violation on the LoadHierarchyFromX which morphs into a .NET system.accessviolationexception - unfortunate. I've had this exception when skinning in MDX, when there was an attempt to access a texture the GC had already disposed of - but this can't be happening now since SlimDX doesn't dispose automatically. I'm doing pretty standard stuff, as per the SkinnedMesh sample + Tom Miller's implementation (but the importance of DestroyFrame and DestroyMeshContainer is somewhat limited by the fact that there are no actual pointers to free) but I can't get my head round this. Any help would be appreciated.

Share this post


Link to post
Share on other sites
Error Message:

An unhandled exception of type 'System.AccessViolationException' occurred in SlimDX.dll

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Stack Trace:

at D3DXLoadMeshHierarchyFromXW(Char* , UInt32 , IDirect3DDevice9* , ID3DXAllocateHierarchy* , ID3DXLoadUserData* , _D3DXFRAME** , ID3DXAnimationController** )
at SlimDX.Direct3D9.Frame.LoadHierarchyFromX(Device device, String fileName, MeshFlags options, IAllocateHierarchy allocator, ILoadUserData userDataLoader, AnimationController& animationController) in c:\...\slimdx\trunk\source\direct3d9\animationframe.cpp:line 708
at gg.MainClass.CreateAnimation(String file) in C:\...\Projects\gg\gg\MainClass.vb:line 425

Share this post


Link to post
Share on other sites
Send me the entire project as a .zip with a clever subject and I'll try debugging it from here. There is too much guess work going on, and I don't have the time to try to reproduce the problem.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!