Storing animations for things other than bones in a skeleton

Problems building or running the engine, queries about how to use features etc.
Error Handler
Halfling
Posts: 77
Joined: Tue May 26, 2009 7:41 pm
Location: Cambridge, United Kingdom

Storing animations for things other than bones in a skeleton

Post by Error Handler »

Hi everybody,

I have made a small Inverse Kinematics class that users can attach to any hierarchial chain of 3 Nodes (i.e. Bones or SceneNodes or a mixture of both). The user can then move/rotate the target handle and attach it to other nodes. The class then updates the rotations of the nodes in the chain to reach the target every frame. The user can choose the method for defining the direction in which the chain hinges outwards - either following the orientation of the target - good for legs and feet, or as a rotation from an initial axis with an offset - good for arms and hands with more degrees of freedom than legs. It also allows the user to specify twist bones for 'forearms' that enhance wrist animation.The IK algorithm is very fast (built upon the simple cosine rule), intended for situations where something like OpenTissue and more complicated solvers are unnecessary and too costly to use on a large scale - e.g. every character in an entire scene's limbs. Before I release this to the wider OGRE community though, I want to try and integrate it with animation in OGRE, so that target transformations and other IK settings can be keyframed and stored with skeletons. This would make animation in OGRE a lot more versatile and accurate in the case of blended character animations where a linear blend between animations is not enough, and dynamic foot/hand placement (this could use a 'Manually Controlled' property similar to bones). Eventually I would like to make a small editor to add this animation to a skeleton.

So, long story short, how do I go about making all of these properties animatable through use of AnimableObject/AnimableValue, and if they are stored as part of a skeleton's animation, how do I deal with serialization and re-linking tracks of all animations to nodes and values, and make it as seamless as possible for users? I could probably figure it out if I pored over the documentation long enough, but I am hoping for advice from someone who has done it before for tips in the right direction.

Thanks in advance
Error Handler
Halfling
Posts: 77
Joined: Tue May 26, 2009 7:41 pm
Location: Cambridge, United Kingdom

Re: Storing animations for things other than bones in a skel

Post by Error Handler »

Update: I have now added AnimableObject support, so that solver properties can be part of Animations, but I have no idea how to get this to serialize and deserialize in a skeleton (if it is possible). I will look into the SkeletonSerializer source for the time being.

Edit: From the source it looks like the SkeletonSerializer only deals with bone animations, and will crash if anything other than bones are used. I may create an alternate version with IK support.