Jump to content
  • Advertisement
Sign in to follow this  
kurlyak

Animation in exported X file DirectX

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

I have made simple animation of walking on the basis of Biped/Skeleton in 3ds max. Then I convert by means of PandaSoft in format X. When in the program try animated this Biped that drops out a mistake: if(!pSkinInfo) MessageBox(NULL,"Error","Error", MB_OK); class CAllocateHierarchy: public ID3DXAllocateHierarchy { public: STDMETHOD(CreateFrame)(THIS_ LPCSTR Name, LPD3DXFRAME *ppNewFrame); STDMETHOD(CreateMeshContainer)(THIS_ LPCSTR Name, CONST D3DXMESHDATA *pMeshData, CONST D3DXMATERIAL *pMaterials, CONST D3DXEFFECTINSTANCE *pEffectInstances, DWORD NumMaterials, CONST DWORD *pAdjacency, LPD3DXSKININFO pSkinInfo, //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! LPD3DXMESHCONTAINER *ppNewMeshContainer); STDMETHOD(DestroyFrame)(THIS_ LPD3DXFRAME pFrameToFree); STDMETHOD(DestroyMeshContainer)(THIS_ LPD3DXMESHCONTAINER pMeshContainerBase); }; And further the condition does not work: if(pSkinInfo) { // first save off the SkinInfo and original mesh data pMeshContainer->pSkinInfo = pSkinInfo; pSkinInfo->AddRef(); // Will need an array of offset matrices to move the vertices from // the figure space to the bone's space UINT uBones = pSkinInfo->GetNumBones(); pMeshContainer->pBoneOffsets = new D3DXMATRIX[uBones]; //Create the arrays for the bones and the frame matrices pMeshContainer->ppFrameMatrices = new D3DXMATRIX*[uBones]; // get each of the bone offset matrices so that we don't need to // get them later for (UINT i = 0; i < uBones; i++) pMeshContainer->pBoneOffsets = *(pMeshContainer->pSkinInfo->GetBoneOffsetMatrix(i)); } else { pMeshContainer->pSkinInfo = NULL; pMeshContainer->pBoneOffsets = NULL; pMeshContainer->pSkinMesh = NULL; pMeshContainer->ppFrameMatrices = NULL; } I read on export X of files from 3ds Max. Here it: http://www.3impact.com/3Impact_Engine/hulk7123/3dsmaxtips.htm But I shall not understand that mean for 3ds Max lines: If you are exporting a mesh with bones, to be loaded by calls to skinmesh functions like iSkinMeshCreate(), all faces/vertices in the mesh must be assigned to at least one bone, even if they constitute a part of the mesh that isn't animated. Otherwise, the mesh will not render in 3Impact. There can be from for it a mistake? And Tiny.x from SDK DirectX animated it is normal in this program, and my file X not animated.

Share this post


Link to post
Share on other sites
Advertisement
you can upload your x-file so others can check it :)


but there is some stuff you need, you will only get a SkinInfo* if your application has bones, means you must export your bones too.


In Panda you can select ExportBones + ExportFrames and the ExportType
must be Sub Frame Hierarchy, animation part doesnt matter here, your problem should be missing bones.


is your x-file totally corrupted or can you open it with DirectXViewer (also there are some x-files that viewer cannot open, but i sometimes can open them^^, especially with skinning :D )



so first thing to be sure is your x-file has frames/bones and your exporting them and you export a subframe hierarchy. If your not quite sure, just open the X-File with visual studio and search for these templates::

XSkinMeshHeader
http://msdn.microsoft.com/en-us/library/bb174836(VS.85).aspx

SkinWeights
http://msdn.microsoft.com/en-us/library/bb147388(VS.85).aspx

i think at least the first must be present (as a instance) for every container that should have a SkinInfo Object

Share this post


Link to post
Share on other sites
During export I set:

Output option: Bones
DX Frame: Sub frame hierarchy

But all the same I receive a "Error":

if(!pSkinInfo) MessageBox(NULL,"Error","Error", MB_OK);

Please help me.

It is mine х a file: http://rapidshare.com/files/235138088/skel_walk.X.html

Thanks!

Share this post


Link to post
Share on other sites
As of_ownage assumed that is not a skinned x file, each bone has it own mesh which is in bone space. I have never used pandasoft for converting instead I have used hplus0603's kW Xport; maybe someone that has used pandasoft can tell you the correct settings to use.

Share this post


Link to post
Share on other sites
Thanks magic_man, but I speak to of_ownage what:

template SkinWeights {
<6f0d123b-bad2-4167-a0d0-80224f25fabb>
STRING transformNodeName;
DWORD nWeights;
array DWORD vertexIndices[nWeights];
array FLOAT weights[nWeights];
Matrix4x4 matrixOffset;
}
And:

template XSkinMeshHeader {
<3cf169ce-ff7c-44ab-93c0-f78f62d172e2>
WORD nMaxSkinWeightsPerVertex;
WORD nMaxSkinWeightsPerFace;
WORD nBones;
}
Is in mine х a file. In what problem?

Share this post


Link to post
Share on other sites
Adding the templates to the file does not make the file a skinned mesh file. If there was skinning information in the model before you exported with pandasoft, then this information has been lost in the reformatting and can not be recalculated from the current data in the x file which was produced. You need to re-export the model using the correct settings in the pandasoft exporting.

Share this post


Link to post
Share on other sites
Thanks for your help. All the matter is that on mine Biped a skeleton was without clothes, without skin that is. I have drawn to it clothes and all has turned out.Excuse for my bad English. Once again thanks!

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!