Sign in to follow this  
ChazH

Loading Skinned Model

Recommended Posts

Hello, I am currently having some issues with loading a skinned mesh. I have been using the code from Advanced Animation With DirectX. I updated the code to use the March 2009 SDK to the best of my ability. I am able to load Tiny with out any issues and get her walking and everything. When I try to load a model that was created with 3DS Max and exported using kW X-port. I get the following message when trying to use CloneMeshFVF. D3DX: ID3DXMesh::GetFVF: The declaration cannot be converted to an FVF Any Suggestions? Thank you, Chaz

Share this post


Link to post
Share on other sites
Quote:
Have you checked that your model's declaration is compatible with the FVF format?


Ive added another section to the code that the post suggested. Which allowed the model to load up until that point but now when I try to update the skinning information and unlock the vertex buffer I get an access violation. What is the best way to check the model's declaration to see if it is compatible with FVF?

Share this post


Link to post
Share on other sites
mesh->GetDeclaration() fills a buffer with format information. mesh->GetFVF() (as you know) gets the D3DFVF bit pattern.

There are several declaration types (see the docs for D3DDECLTYPE and D3DDECLUSAGE) which don't have FVF equivalents - tangents, binormals, etc. That may be the problem.

I've not run into your problem so I'm not sure, the problem may be the order of the declarations. D3DFVFs must be in a specific order. If the declaration isn't in the correct order to form a valid FVF, that may cause the error.

That is, FVFs allow several elements for the vertex format: D3DFVF_XYZ, D3DFVF_NORMAL, D3DFVF_DIFFUSE, D3DFVF_SPECULAR, D3DFVF_TEX1, etc.

NOTE: the elements of the vertex format must be stored in the vertex buffer in the order shown for those FVFs. E.g., if a vertex declaration has vertex position (equiv. to D3DFVF_XYZ), a diffuse color (equiv. to D3DFVF_DIFFUSE) and texture coordinates (equiv. to D3DFVF_TEX1), they have to be in that order. However, if the declaration has the position followed by the tex coords, followed by the diffuse color, there is no equivalent D3DFVF for that order.

You can try CloneMesh (a different form of that function) with the declaration, instead, and see if that works.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this