ID3DXMesh::Optimize and ID3DXSkinInfo

Started by
2 comments, last by Rompa 17 years, 3 months ago
Hi there, I'm in the process of replacing DirectX's .X loader with custom importers for various different file formats. I've got it importing non-skinned meshes fine, but got a few problems loading a mesh that needs an ID3DXSkinInfo object attached to it. My theory is that it might be my call to Optimize the mesh to build the attribute table that is breaking things. Does anybody know if Optimize is smart enough to reconfigure the bone weightings etc. in the SkinInfo object with the reordered vertex indices? Optimize returns a mapping from the old indices to the new ones, so I kind of wondered if I might need to make sure I looped over each bone and reordered them manually, but I guess it would be pretty dumb if Optimize failed to do that for you. I'm using ye olde original DirectX 9 SDK.
Advertisement
I don't know about Optimize, but I do know Clean completely broke my skinned meshes when I was using it (even if it didn't actually clean anything!). It doesn't seem improbable it would be the same for Optimize. You may be able to get away with the flags you can pass in ConvertToIndexedBlendedMesh.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
ConvertToIndexedBlendedMesh options flag D3DXMESHOPT_VERTEXCACHE would do something optimize.
Note that if you Optimize a mesh that has an associated ID3DXSkinInfo then you'll need to ID3DXSkinInfo::Remap it.

This topic is closed to new replies.

Advertisement