How to select a specific Clip

Jul 25, 2008 at 3:11 AM
Hallo there,

i found your library few days ago and today i viewed u're samples and tested it with my models. It was no Problem to load my Model and playing all animations. It works very well. Now i've looked how i can play a seperate clip. I saw in you're first example that you can get a animationclip by name(in youre case 'idle'). But my Files havent a clipdescription. Just 'Take 001'(default from maya) and then the complete animation stuff without seperate names. I dunno how can i put also animationnames in my file!Does anybody know?Perhaps just a simple option in maya?

Okay the i go over to the next example to look if you're working perhaps with the *.xml. Because i know the start and the end frame of my animations too. But i never found a call of this file and your library also to not call the xml!I'm right?Cuz i just deleted the file for testing and nothing changes. The expamples runs fine!So how i can say your library that i have a file in whitch the frames a declarated?Or is it possible that i missunderstood something?Because why u have an xml-file when u dunno use?

Thanks for your advice
best regards
Kampfgremlin
Coordinator
Jul 26, 2008 at 12:17 AM
Hi. The third sample uses the xml do split the model's animation. All the exporters that I know (including the latest FBX exporter) only export one animation track, usually named Take 001. Then you can use the XML to slip this animation track in as many tracks as you want.

When you removed the XML it continued working probably because it does not compiled the assets again, the content pipeline does NOT rebuild the assets when you modify the XML file. You need to manually ask it to rebuild everything.  Also, you set the XML file used to split the animations in the parameters of the "Model - XNAnimation" processor. Go to the Content project, and select properties in your model, in the property window expand the Content Processor item, there you will find the link for the XML file that it was using.
Jul 26, 2008 at 10:53 PM
Thx for your reply!It works wonderfull :D
Feb 3, 2010 at 3:30 PM

Hi bpevangelista, from what you say, I try to modify the codes for EnemyBeast.xml and rename it for my fbx. But I keep getting the error message saying this xml file has the same asset name as the xnb file in another folder. I realise that EnemyBeast also has an EnemyBeast.xnb in that folder but EnemyBeast.xml can still be built and compile, For me, even I did exactly the same as the placing of the xml file, it still won't build. Can you help me with this issue? Thank you

Developer
Feb 3, 2010 at 3:41 PM

Since XNA compiles all the content to the same file type (XNB), it doesn't take into account the file extension. So, if you have for example "MyChar.fbx" for the model and "MyChar.tga" for the texture, they both would get compiled to "MyChar.xnb", thus leading to errors. Try naming your animation XML as "EnemyBeastAnimations.xml" and put that filename in the "Split Animation Filename" field of your model.

Feb 3, 2010 at 3:53 PM

Sorry I don't really get what you mean by putting that filename in the "Split Animation Filename" field of my model. where can I find this field? I have been looking through most of the properties but can't see the one you mention.

Developer
Feb 3, 2010 at 4:09 PM

You  must set "Model - XNAnimation" as the Content Processor of your model. Check this screenshot for more info:

Feb 3, 2010 at 4:19 PM

Ic ok i follow your instructions and now I get this error message. May I know whats wrong?

Developer
Feb 3, 2010 at 4:22 PM

Your XML file has an invalid format :( Are you sure you don't have any whitespaces or new lines before the <?xml version="1.0" encoding="utf-8" ?> declaration?

Feb 3, 2010 at 4:36 PM

r2d2rigo, you have really solved my problem. Thank you very much. Really grateful for your help.

Btw I also realised that besides giving the animation xml another name so that it will not conflict with the xnb file, i can right click on the animation xml file under the content\model folder(Where I placed it) and exclude it from project. This way it works as well.

Thanks for you help again.