Jump to content
  • Advertisement
Sign in to follow this  


This topic is 3932 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 have a problem with D3DXLoadMeshHierarchyFromXInMemory and maybe you can help me out. I'm using X files in my project and everything works just fine. I can load animated models with no problem. But now I just got a new model, witch after converting to an X file (kwXporter) cause D3DXLoadMeshHierarchyFromXInMemory to return D3DERR_INVALIDCALL. The debug d3d writes this to the debug output: Assertion failure! (h:\gfx_sdk_november\windows\directx\dxg\active\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. I just can't do anything with it. If anyone have some experience about this error, plz let me know.

Share this post

Link to post
Share on other sites
I've found the problem. If you get a frame in ID3DXAllocateHierarchy::CreateFrame with a NULL name, the created D3DXFRAME::Name must be NULL and not an empty string! I wonder why does it work on other meshes.

Share this post

Link to post
Share on other sites
Hello, I'm tired with it.

I'm doing a pak sys, now process the X buffer to archive serializtion

the api as bellow

HRESULT D3DXLoadMeshHierarchyFromXInMemory(
LPCVOID pMemory,
DWORD SizeOfMemory,
DWORD MeshOptions,
LPD3DXFRAME * ppFrameHeirarchy,

My question is How can I get the pMemory, that's Pointer to a buffer that contains the mesh hierarchy.

If you know about it, pls tell me! thx

Share this post

Link to post
Share on other sites
byte* pMeshFile = NULL;
long lMeshFileSize = 0;
if ( FILE* pFile = fopen( "whatever.x", "rb" ) )
fseek( pFile, 0, SEEK_END );
lMeshFileSize = ftell( pFile );
fseek( pFile, 0, SEEK_SET );

pMeshFile = new byte[ lMeshFileSize ];
fread( pMeshFile, lMeshFileSize, 1, pFile );

D3DXLoadMeshHierarchyFromXInMemory( pMeshFile, lMeshFileSize, whatever...

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!