Sign in to follow this  
tuxbook

Swapping Multiple X Meshes WIth Animation

Recommended Posts

Hi guys, I have an interesting situation with my player--The player has several animations animated with slightly different rigs (the idle, run, and jump animations were on the original rig, newer animations required a better rig). Previously I've loaded the mesh from the first animation as the base mesh, and then added the AnimationSets from the other animations to the base mesh's AnimationController. I then made a tool to merge AnimationSets from separate files into one .X file, again using one of the files as a base mesh. This works fine, except for the differences between rigs. If I use the original rig as the base mesh, I lose facial animation. If I use the newer rig I get slight deformations in the face. The system I'm working on now loads a merged .X file for each rig (one file with the old animations in it, one with the new facial rig animations). My original plan was to keep one AnimationController with all of the animations in it and then switch meshes when swapping to an animation using a different mesh. When I tried this, only the animation from one of the files worked. I'm cloning both the animation controller and the whole frame hiearchy for each mesh. I've tried everything I can think of to try to get this to work. I've tried saving each file's loaded animation controller with the mesh and swapping animation controllers out. I've tried merging all of the mesh's animations together and then cloning that to each mesh's storage. I've tried calling D3DXFRAMERegisterNamedMatrices() in every case--this fails when I try to register the second mesh with the animation controller, which is why I tried registering with separate animation controllers and swapping them. The problem is usually that animations will play for the last mesh loaded, but not for any others (which seems screwy considered each mesh is loaded separately and animation controllers are also save separately). But no luck so far. Any ideas? Am I approaching this right? Thanks.

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