Skip to main content
GameDev.net gamedev.net
🔒 Locked

[SOLVED]Mesh Hierarchy Export using kW X-Port

Started by programci_84 Jun 29, 2009 at 1:10 PM 10 replies 2.2k views
Original Post
programci_84
programci_84
Hi all, I'm working on skeletal animation support for my graphics engine. Now I can load and animate some existing skeletal meshes. I have an .md5 importer for 3ds max and I load Doom3 models and animatons into 3ds max platform by using it. I'm using kW X-Port to convert'em to .X files. There's no problem with converting and opening'em with DirectX Viewer. But I can't load using my application. D3DXLoadMeshHierarchyFromX() function returns -2005530516. I'm using 3ds Max 2008. Does anybody know how to export models and skeletal animation data regularly with kW x-Port? Thanks in advance. [Edited by - programci_84 on June 30, 2009 9:19:49 AM]
There's no "hard", and "the impossible" takes just a little time.
programci_84
programci_84
There's just "Direct3D9: (ERROR) :Unlock failed on a buffer; vertex buffer wasn't locked."

But I don't use any Lock() Unlock() pair in CreateFrame() or CreateMeshContainer().
There's no "hard", and "the impossible" takes just a little time.
legalize
legalize
Did you link against the debug D3DX or just switch the core runtime in the control panel? To get debug messages from D3DX you need to link against a different import library, d3dx9d.lib
programci_84
programci_84
Hi,

First, thanks for your help.

I'd only switched the debug runtime from DX Control Panel before. Now I added a link "d3dx9d.lib" and started debugging, but got same message.

What does that -2005530516 mean?

Thanks again.
There's no "hard", and "the impossible" takes just a little time.
Schrompf
Schrompf
Use the DirectX error lookup utility. But it will mostly tell you "Invalid Parameter" or something... error codes are next to useless and overrated in general.

I've seen the D3DX mesh loader to fail on a lot of otherwise valid files... that's why I implemented the parsing myself, as did Irrlicht, for example. My version of the loader is now available as part of the Open Asset Import library, which also loads 20+ of other 3D scene formats for you, including Doom3 models. But of course you're free to roll your own, instead, and implement all the necessary special cases, workarounds and bugfixes over the next months.
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.
programci_84
programci_84

Vielen Dank für Ihre Hilfe, Schrompf :) Ich habe "assimp viewer" zu laden. Es stürzt ab :)

I've never used "The Debug Runtimes", so I didn't know how to debug the app regularly. So, thanks to Steve Macpherson for publishing DruinkJournal. I've learnt how to do now.

Anyway, I saw these lines in the Debug window after calling D3DXLoadMeshHierarchyFromX():
"Assertion failure! (h:\gfx_sdkaugust08\windows\directx\dxg\d3d11\d3dx9\anim\loadxh.cpp 1392): D3DXFrameNumNamedMatrices(pframeRoot) == plc->cNamedMatrices
D3DX: ID3DXAnimationController::RegisterAnimationOutput: Number of matrices registered is equal to the max number set at creation time."

Do you smart guys know what does that mean? What must I do?

Thanks.
Rohat.
There's no "hard", and "the impossible" takes just a little time.
programci_84
programci_84
Alright guys!

I've solved my problem.

That's how I fixed it:
In definition of CreateFrame() function, don't copy any Name data (such as "" or "") if the incoming Name parameter of CreateFrame() is NULL. Just pass NULL.

I did it and now it works perfect :) But I don't know why.

Thanks again.
There's no "hard", and "the impossible" takes just a little time.
legalize
legalize
Quote:
Original post by Schrompf
I've seen the D3DX mesh loader to fail on a lot of otherwise valid files...


I would like to see an example of such a file. Chances are its the file that's wrong and not the D3DX mesh loader. There are lots of people writing out .x files themselves and getting it wrong because they don't understand the format.
Schrompf
Schrompf
Quote:
Original post by legalize
I would like to see an example of such a file. Chances are its the file that's wrong and not the D3DX mesh loader. There are lots of people writing out .x files themselves and getting it wrong because they don't understand the format.


Ok, we probably have a different definition of "valid" here :-) There are a lot of exporters for various modellers that write invalid files. Be it the XPort plugin for Maxon Cinema 4D which puts some additional separators here and there, be it the Blender XFile exporter writing #INF or #NAN literals instead of numbers, or be it some strange exporter writing localized number strings, which leads to funny text such as "3,562354, 5,243535, 20,30493;;" because the locale told the plugin that fractionals are separated by a comma at the local machine...

The problem is that everyone expects our library to load all those files. Upto now we didn't manage to convince plugin authors to us our library as reference :-) That's where we got busy, and added all sorts of workarounds. You can't do that with D3DXLoadMeshHierarchyFromX(), the parsing is fixed. Hence the suggestion to replace it with a more generous function.

I'm sorry if my miswording caused you trouble.

BTW: to me it appears as if the separator usage isn't actually defined all that clearly, opening the field for all sorts of variations. I've seen a hell of a mixture of comma and semicolon there, as well as arbitrary counts of those. As a consequence Assimp's parser doesn't distinguish between the both, as do all other XFile parser I've seen upto now. *Maybe* that's a hint on what's wrong with the format.

[edit]@programci_84: did you use the most recent release from the website? It's from the beginning of may, I think. If yes, and your file still crashes the viewer, please send the file to me. thomas [aet] dreamworlds [dut] de

Bye, Thomas
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.
dmail
dmail
Quote:

I've seen a hell of a mixture of comma and semicolon there, as well as arbitrary counts of those.

IIRC the 3.0 doc states what is correct usage for comma and semi colons. Although I do wonder if this still holds true, due to the fact that some of the samples which come with the DirectX SDK have incorrect usage.
Schrompf
Schrompf
Just a quick update: the model programci_84 mentioned loads fine. It's just the viewer which crashes. The viewer does skinning in the vertex shader, which puts a hard limit on how many bones a model can have. The viewer supports 60, the model has 102. We really ought to put a warning label there...
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.