.X files animation duration problem

Topics: User Forum
Aug 1, 2011 at 6:58 AM

Hi, sorry if this post has been done already, I've looked and can't find anything on it.

I'm using XNA 4.0 and this library for animations and I love how simple yet powerful it is. I downloaded an updated sample of the dwarf model animator and I've been using that as a reference along with the XNA 2.0 tutorials on this site. My problem comes from my .x model I believe. It is not playing the animations, it'll take a pose from the animation but it won't play the whole animation. Through some debugging and experimenting I found that if I use the dwarfmodel.x from the sample, the animations play just fine. I printed out the duration (AnimationController.duration) for both models. My model has a duration of 0 while the dwarf model has a duration of 7990000. I'm not entirely sure about my process of exporting the model is right. (sorry if this question is out of place) I use Milkshape3D to create and animate my models. I then export it to a .x format. I've used the DirectX 8.0 File exporter and the DirectX (JT) exporter with the skin and bone settings. Both yield similar results. So my question is: Is there some thing I need to do specifically to create animations and set their durations? Any help would be appreciated. If anyone needs me to post my .x model I can. Also I have created my XML file using the dwarfmodelanimation.xml as a guide and it's loading them correctly from what I can tell, I can post that as well if you would like.

Thanks in advance

Nov 16, 2011 at 2:42 AM

Try setting in you model properties:

Content Importer -> X File - XNA Framework
Content Processor -> Model - Animation Library

It works like this to me. Although sometimes the animations won't play correctly. In that case I just change my model settings to:

Content Importer -> X File - Animation Library

I compile, it gives an error, I switch it back to the settings I told you firsts, compile & everything works fine with the correct animations!
Check it!

Good luck,

P.S.: I'm in XNA 3.1, I don't know if it's the same in 4.0