Jump to content
  • Advertisement
Sign in to follow this  
Michael1984

D3DXLoadMeshHierarchyFromX

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

Hello, first of all i want to apologize for my english. I try to load a morphed character. To do this i use the function D3DXLoadMeshHierarchyFromX and create a class CLoadUserData. class CLoadUserData: public ID3DXLoadUserData{ public: STDMETHOD(LoadFrameChildData)(THIS_ LPD3DXFRAME pFrame, LPD3DXFILEDATA pXofChildData); STDMETHOD(LoadMeshChildData)(THIS_ LPD3DXMESHCONTAINER pMeshContainer, LPD3DXFILEDATA pXofChildData); STDMETHOD(LoadTopLevelData)(THIS_ LPD3DXFILEDATA pXofChildData); CLoadUserData(){} }; But i have a problem. Can anybody tell me who i can read out my user defined data fropm the x-file? HRESULT CLoadUserData::LoadTopLevelData(LPD3DXFILEDATA pXofChildData){ hr=pXofChildData->GetId(&pId); if(FAILED(hr)) return hr; hr = pXofChildData->GetType(&type); if(FAILED(hr)) return hr; hr=pXofChildData->GetName(NULL, &cchName); if(FAILED(hr)) return hr; hr=pXofChildData->Lock(&dwSize, (LPCVOID*)&pData); if(FAILED(hr)) return hr; // read data? hr = pXofChildData->Unlock(); if(FAILED(hr)) return hr; return hr; } Thanks, Michael. Edit: This is an extract from the x-file: ... template MorphAnimationKey { <2746B58A-B375-4cc3-8D23-7D094D3C7C67> DWORD Time; // Key's time STRING MeshName; // Mesh to use (name reference) } template MorphAnimationSet { <0892DE81-915A-4f34-B503-F7C397CB9E06> DWORD NumKeys; // # keys in animation array MorphAnimationKey Keys[NumKeys]; } ... MorphAnimationSet Dance { 7; 0; "Figure1";, 500; "Figure2";, 1000; "Figure3";, 1500; "Figure4";, 2000; "Figure3";, 2500; "Figure2";, 3000; "Figure1";; }

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!