Exporting an animation into Havok format, which is the format Elemental uses, had been driving me crazy for a long time. Now I think I have debunked one great mystery on how to get the skeleton, mesh and animation into a separate file. If you explore Elemental's folders you will find out that this is the way the 3D assets are handled and you will find all these files separated all over different folders.
In order to be able to do this you need to download the following:
Havok Content Tools http://software.intel.com/sites/havok/ approx 250MB. You need to fill out some info first.
First of all I did this using a model that was made for a Havok Tutorial that can be found in the digital manual that comes with these tools. I highly recommend that you read this manual as it contains info on all the filters and has some tutorials that help you understand how it works. The tutorial I followed was "Tutorial: Export and Animation Basics" and the model used for this tutorial can be found in the "scenes/havokContentTools/tutorials/exportBasics/tutorialStart.max" folder. This model contains a girl that is running forward and I hope that what I did can be carried over to any model you may have.
Ok so now that you opened the model the first thing you want to do is navigate to "Havok Content Tools" in the main bar and click Export. This will bring up the Filter Manager and is the only place you'll need to fiddle around to get your files. I won't be going into much detail since I still don't really know how to properly use most of these filters, so feel free to experiment with them and if you discover something feel free to share the info .
It is extremely important that you take note of the order the filters are placed. The filter order goes from top to bottom and if you place em in the incorrect order you might get errors and get unexpected results. Also note that moving them around is fine, you will only get errors at the time you press the "Run Configuration" button seen in the picture below.
The first Filter you will add is Trasnform Scene, and I added this because according to the tutorial Havok's runtime uses meters as it's base unit and since 1 3DSMax unit is 1 inch this is required to properly trasnform the model's size. Add the filter as shown in the next picture and choose "INches to Meters" on the right hand side options:
The next filter you will add is the Create Skeleton filter found in the animation tab. The name is self explanatory and if you opened the Havok Tutorial girl you will see that the bones are added to the list on the right side of the Create Skeleton options. Now I'm pretty sure that for our own custom models we will have to manually add our Rig. In that case I think you only need to click the "Manual" circle in the Build Rig options. After doing that the Add button in the Bones section will turn on and you can manuall add the bones. The same applies to the animations.
After adding your skeleton the next filter you will add is the Create Skins filter, example below:
Up next is the Create Animation filter. This one has similar options to the create skeleton option for obvious reasons, and in the case of the Havok tutorial the Automatic Option worked fine:
Now if you want you could use the Preview Tool to see what these filters will be creating. The preview tool is really really useful since this way you don't have to create a file everytime you do some changes. In fact you should use the preview tool everytime you plan on actually creating a file. Anyways add a Preview Tool to see what happens by going to the Graphics tabs like seen in the next pic then click "Run Configuration":
If you ran the configuration above, then you should get a Havok Preview of the girl running a constant loop:
Thats what it would look like if you made an .HKX file right now but thats not what we want. We want to break the Mesh, Animation and Skeleton into three separate files. How do we do that then? Well lucky for you I kept banging my head on this for a long time. The answer is simple, you need to add "Prune Types" filter. What this does is it "Prunes" or deletes parts that you specify, like the Skeleton or the Mesh which in the end will allow us to have our desired result! Yahtzee.
Ok so now we need to add the Prune Type filter and please remember it is EXTREMELY important that you properly order it in the Configuration set as seen below:
Notice how I moved Prune Types ABOVE the Preview Tool. If I leave Preview tool above Prune types then I would get a preview of the first 4 filters but I would'nt preview whatever the Prune Types did.
If you notice the Prune Types options on the right, you can see there are several Boxes you can check. These boxes are what we want to play around with.
At this point you should be able to get rid of the Preview Tool filter, but I highly suggest that you run it everytime you make a change. Now that we are almost done, I'm just going to give you the check boxes that you need to enable in order to export the Mesh/Animation/Bones into separate files.
First of all, in order to export the file you need to add a "Write to Platform" filter which will create the .HKX file we are looking for. Example below:
You should choose an easy to look location (like the Desktop) as your path to save your file. If you don't change the default filename then you need to create the file, then go to the directory and rename the file you created, because if you don't the file you create next will have the same name and will Override the previous one.
You need to do this 3 times, 1 time for each the Skeleton, Animation, and Mesh. Below are the settings you need to change in the Prune Types Filter in order to obtain the desired result.
Settings if you want the Skeleton only:
Settings for the Animation only:
Settings for the Mesh only:
Now you should be able to have 3 separate files each containing an Animation, Mesh, or skeleton. If you want to test this, go to Start>All Programs> Havok and look for the Havok Preview tool.
If you open this then drag these 3 files 1 by 1 and click "just" add to scene you should be able to see the fruits of your labor. Note that if you add the animation file you will not see anything at all. Same for the skeleton, if you add the skeleton by itself it will be just standing there. If you mix them both then the skeleton will start running. Same for the Mesh.
Thats that, I hope that this really means that we can actually import our animations into the game. The next step is to figure out if we can actually do it through XML atm. I will be attempting it sometime soon but if someone wants to go ahead and try here are the 3 files for the exported animations.