• Advertisement
Sign in to follow this  

Cannot load .x file Hierarchy

This topic is 3728 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

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Hi, in that case try just a block and export that and see if you can load it.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Additional info:

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

Thanks,

JI

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Following this guidelines I was able to successfully export and load with hierarchy some of the models I am working with:

"The one thing you need to remember when creating models for export to the .x file format is to make sure you end up with a mesh(...). If you use splines or something to create the model make it into a mesh before export. In the '3DS max objects' tab of the exporter dialog I turned on 'Include Animation' and 'Bones'. Under the 'animation' tab I made sure it was set to export 'matrix keys' (otherwise discontinuity problems can happen with the animation). Under 'Textures & Effect Files' I chose to 'Copy the texture map' - this makes it easier with texture finding etc. when loading the x file(...)"

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

I am still in trouble with some of the models tough, but I am not proficient in 3D studio modeling (let's just say I don't know anything about it) and I have no idea what should I check in order to fix this annoying issue.

Any help would be appreciated!

JI

Share this post


Link to post
Share on other sites
Quote:
Original post by John_Idol
the code that LoadHierarchyFromX gives me back is "-2005530516".
Anyone has any idea of what that means?

That's signed long for 0x8876086C, which is DWORD for D3DERR_INVALIDCALL.
Not much help there then [rolleyes].

Admiral

Share this post


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

  • Advertisement