Hi.
We are using Maya 8.5 and the Havok exporter.
The Animation Container class in Havok has a function FindSkeletonByName, but I see no FindAnimationBindingByName. I've looked at the documentation on the hkaAnimationBinding class and there doesn't seem to be any way to name animations.
We need to be able to name our animations so that we can use the right animation for the right skeleton. Does anyone know of a way to do this, and then obtain the animation name in code?
Naming Animations
Naming Animations
For more complete information about compiler optimizations, see our Optimization Notice.
Hi jbrindle,
You are correct that there isn't a name associated with the animation. There are probably different things you can do based on what your exact use-case is. It sounds like you are storing all the animations in a single file, is that correct? Are you storing each character's animations in their own file? Are you trying to share animations between characters?
Putting an annotation of the name on the root bone of the skeleton is an option and writing a custom filter to do what you want is pretty much always an option.
Let me know what you think.
Thanks,
Sean
Developer Support Engineer
Havok
www.havok.com
Hi Sean.
Thanks for a speedy reply!
As a simple case, I have 2 character meshes that are bound to the same skeletal structure.
Each character mesh is in its own file. I then have a file that has just the animation data.
I would like to apply this animation data to both meshes. Using the animations by index is working, and I see both meshes moving the way they should.
However, it would be beneficial for us to have the animations have names so that I can tell which animation I am creating an animation control for.
I do not have a guarantee that the animations will be added to the animation container in the same order, since our animation data files are set up to contain any particular animation or set of animations So assuming 0 is the walk, 1 is the run, etc is not really an option.
How are other games keeping track of which animation is which?
A little more information:
As I load the mesh and animation data I am adding it to a global "Animation Container"-like class. It has a list of meshes, skeletons, animation bindings, skeletal animations, etc just like the animation container class.
Every time a havok file is loaded, it is appended to the data in this global structure.
So that is why as I add more meshes and more animations, I need to know which animations are for which mesh and what kind of animation it is.
For example, if I load a horse and then a horse animation file. Then load a guy and a guy animation file. I need a way to be able to tell which animations are for the horse and which are for the guy so I can link up the meshes to the right animations.
Is there a way in Havok to do this, or is it better to implement this sort of thing in the game engine?
Hi jbrindle,
There are few options you can take here and maybe there are some other options I didn't think up.
1. Put an annotation on the root bone of each animation at frame 0. You could then read the name at runtime and put it into your global animation container. There are docs, Havok Content Tools->Common Concepts->Animation: Annotations, and there is the AnnotationDemo.
2. Change the way you are exporting so that each animation in its own file, then use the filename as the name in you system.
3. Pretty much do what you are doing now using known indices into the animation container. The idle animation will always be 0, walk will be 1, etc. Like you said it makes things a little complicated, but if you are only doing a strict set of animations for each character then this can work out well.
4. Write your own filter and you can pretty much do anything you want. There is a filter tutorial that comes with tryHavok and there is a section in the docs, Havok Content Tools->Integrating with Havok Content Tools->Writing your own filters, that should be helpful.
I didn't put these in any specific order. Let me know what you end up doing or if you come up with a better solution.
Thanks,
Sean
Developer Support Engineer
Havok
www.havok.com


