Sign in to follow this  

Play .x animation file on frames in XNA

Recommended Posts

Hi. I've made a biped in 3ds max, converted it to editable mesh and exploded each part to objects so that it it shown as a model when exported. Then I've made another biped atop of this one and linked the parts I want to move (the arms) of the exploded objects to the biped and then animated the biped so that the objects move. I've followed this tutorial on how to export the model with animation to .x file format for use with XNA: link But when searching for a way on how to play of this animation in XNA, I can not seem to find a proper way to do this, other than using libraries. But I was really looking for how this is done without the use of helper libraries. I've tried using this example program with my animated model: link But when I try this, the program throws the following exception when loading content:
currentModel = Content.Load<Model>("mandraw");

// Look up our custom skinning information.
SkinningData skinningData = currentModel.Tag as SkinningData;

if (skinningData == null)
   throw new InvalidOperationException
      ("This model does not contain a SkinningData tag.");

I dont have too much experience in 3d modelling, as is why I am currently using a biped as a placeholder for the character. But I've read a bit on skinning in the 3ds max reference, and found out this is used for clothes and such wrapped around a model, and can't see why this is required to be able to animate a simple model. Is there no way I can play of my simple animated model easily by keyframes in the .x file in XNA? Thanks in advance.

Share this post

Link to post
Share on other sites
Did you set your model to use the correct Content Pipeline type? IIRC, that XNA example uses a custom content pipeline (though i'm not 100% sure on this :)). Is there a reason why you don't want to you an external library? Since you want to do things the "easy way", why not use something like XNAnimation? It makes it super easy to use skinned models.

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