   [SOLVED]Mesh Hierarchy Export using kW X-Port
  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]
  Link against the debug D3DX and look in the debug output stream for the cause of the failure.   ;  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().   ;  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   ;  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.   ;  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.   ;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->cNamedMatricesD3DX: 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.   ;  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 "<Noname>") 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.   ;Quote:Original post by SchrompfI'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.   ;Quote:Original post by legalizeI 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] deBye, Thomas   