How to export multiple animations with fbx

Topics: User Forum
Feb 14, 2007 at 9:11 AM
Hi, first of all I want to say good work with the library.

When using the x format you can name your animations when exporting them with the Pandasoft exporter, but when exporting with the fbx exporter you don't have those options. So my problem now is how I am supposed to control witch animations are displayed in my game. Do I have to write some kind of function that controls witch frames that are displayed?
The reason that I want to use the fbx format instead of the x format is that the x format (as I have understood it) doesn’t support specular maps.

Thanks in advance
Coordinator
Feb 14, 2007 at 9:30 AM
The fbx importer doesn't import specular maps either, even if they are part of the fbx format. To get specular maps to work, you'll have to export to some other data file.

To answer your question, you can access animations by index, or you can export animations to bvh/asf if you are fortunate enough to have a plugin that does so. I don't know if there are any free such plugins.
Coordinator
Feb 14, 2007 at 9:36 AM
Oh.. are you asking how to split up an animation into parts? Can you not export multiple animations in fbx format?
Feb 14, 2007 at 9:50 AM
No I can't split them up. The only option I get is to export animations or not.
Coordinator
Feb 14, 2007 at 11:15 AM
Assuming it exports to .x the same it exports to .fbx, you can first export to .x ascii, read the AnimTicksPerSecond node value, and then use the .x file to make the xml animation split file. You can then use that with the fbx file.

A hassle, I know. I'm surprised you can't export multiple animations to an fbx file. I haven't posted how to make the xml file that says how to split up the animation yet, but I explained it another thread today.
Coordinator
Feb 14, 2007 at 11:21 AM
Oh yeah, you can't specify the animation in the xml file because it is nameless. I'll add the ability to reference an animation in the xml file by index, which is only a few lines of code for me. Would this solve your problem?
Mar 16, 2007 at 10:41 PM

dastle wrote:
Oh yeah, you can't specify the animation in the xml file because it is nameless. I'll add the ability to reference an animation in the xml file by index, which is only a few lines of code for me. Would this solve your problem?


I would be very interested in how something along those lines can be done. 3DS Max's .fbx exporter only exports to one large animation called 'Take 001' (there's supposed to be a way to export multiple takes as separate files but it doesn't have any documentation and I can't even attempt to activate the option). Between the lack of documents etc I'd much rather just split it up with an .xml file.

If I could index a group of frames in that 'Take 001' anim and give them a name to pass to the controller that would be ideal.
Coordinator
Mar 16, 2007 at 10:52 PM
Read the second tutorial (Splitting up an Animation using an XML file) for documentation on how to do this. Does this answer your question?
Mar 16, 2007 at 11:16 PM
Edited Mar 16, 2007 at 11:39 PM

dastle wrote:
Read the second tutorial (Splitting up an Animation using an XML file) for documentation on how to do this. Does this answer your question?


Unfortunately not. I have tried using an XML file with this .fbx but it's not working properly.

Just for reference, if in my XNA code I do the following (without having an xml file) it works fine basically, just that it plays all my anims in one looping sequence.
walk = new AnimationController( this, TestAnimator.Animations["Take 001"]);

So I wrote an xml file to break it up, here's the contents:
<animation>
	<tickspersecond>60.0</tickspersecond>
	<animationsubset>
		<name>walk</name>
		<startframe>1</startframe>
		<endframe>60</endframe>
	</animationsubset>
	<animationsubset>
		<name>hurt</name>
		<startframe>61</startframe>
		<endframe>90</endframe>
	</animationsubset>
	<animationsubset>
		<name>death</name>
		<startframe>91</startframe>
		<endframe>150</endframe>
	</animationsubset>
</animation>

and in my code I put:

walk = new AnimationController( this, TestAnimator.Animations["walk"]);
hurt = new AnimationController(this, TestAnimator.Animations["hurt"]);
death = new AnimationController(this, TestAnimator.Animations["death"]);

When I run the program I get the KeyNotFoundException error for all the Anim controllers.
Coordinator
Mar 17, 2007 at 2:25 AM
Hmm.. did you do rebuild all after making the xml file?
Mar 17, 2007 at 6:04 PM

dastle wrote:
Hmm.. did you do rebuild all after making the xml file?


Oops.... I coulda sworn I had done that. That fixed the problem.
Thanks