Cannot load .x file Hierarchy

Started by
10 comments, last by TheAdmiral 16 years, 5 months ago
Hi Everyone, I am an absolute beginner, trying to develop a 3d viewer, importing models with animations from 3d studio in .x format. Following problem: I am able to load my x files with D3DXLoadMeshFromX but not with D3DXLoadMeshHierarchyFromX. With the models provided in directX samples everything works fine in both ways. I need to load the hierarchy 'cause I need to display animation. No idea about possible reason! Can someone help? Thanks in advance, JI
Advertisement
You're doing something wrong or have a bad model. Need more information? Then give us more information!

How are you unable to successfully use D3DXLoadMeshFromHierarchy? Tell us any error codes that are returned and explain any relevant behaviour or lack thereof. If you think that all of this is in the ordinary then show us the shortest snippet of code that completely describes the problem area.

Admiral
Ring3 Circus - Diary of a programmer, journal of a hacker.
Hi Admiral,

thanks for answering. I know I've been vague, it's 'cause I dont have any clue about the problem.
The code I am using is basically the same as this sample:

http://www.toymaker.info/Games/html/load_x_hierarchy.html

I have been changing just some UI detail but the routine and classes I am using are the same.

It works fine with any DirectX sample model I tried, but not the custom ones I exported from 3D studio with PandaSoft; in this case D3DXLoadMeshHierarchyFromX is returning < 0 (indicating Failure). I am able to load the same models if I load the x file without loading the hierarchy, so I guess there is same problem with the way the animation is being exported (I just ticked "include animation" when exporting).

Any guess?

Thanks for any help!

JI
In my experience, exporting X files is very fiddly. Producing something that D3DX is happy with seems to be the exception, rather than the rule.

Could you tell us exactly which error code is being produced? That's the first stop to fixing things. If your debugger's any good then it'll decode the DWORD into a meaningful HRESULT. Otherwise, a little creative Googling can turn the numerical value into a constant name.

Beyond that, I can't really help. With any luck, somebody will drop by this thread with some knowledge of the Panda exporter.

Admiral
Ring3 Circus - Diary of a programmer, journal of a hacker.
Hi there, it may be the exporter if you have a mesh with physique and a biped then I could neaver get them to work so try this exporter and see what you get
kiloWatt X file Exporter for 3dsMax version 9
http://kwxport.sourceforge.net/

Hope this helps, it was a wall to me to...
Thanks!

I don't think I have any physics in there and I dunno what biped is (...). Anyway I'll try as soon as I can and let you know.

Thanks again,

JI

Hi, in that case try just a block and export that and see if you can load it.
Sorry I am a newbie:

What d'you mean for "export just a block"?

Strange thing is if I don't try loading hierarchy info (Simple LoadFromX) everything works just fine.

Thanks,

JI
Additional info:

the code that LoadHierarchyFromX gives me back is "-2005530516".
Anyone has any idea of what that means?

Thanks,

JI
Update:

After running some more tests, the implementation of ID3DXAllocateHierarchy interface I am using seems to be working perfectly. All frames and meshes are being loaded correctly as I can see from the debug output (I am printing frame names if any) returning correct result values (SB_OK). So I would exclude any problem there.

I am gonna try with the other exporter and see what happens.

Thanks for helping.

JI

This topic is closed to new replies.

Advertisement