Wednesday 30 March 2011

Finished the building blocks of my animation system

Some time ago you may have read a post about a WIP animation system that I had started working on. Even though it was never really abandoned I had little free time to work on it, and improvements were made in (VERY) small batches.

That was until last weekend, when after a 10-hour sitting I managed to get all the basic blocks done (finally) . All that remains now, is to bring the GUI up to date... so it can actually be used :D

The animation system itself is (for now) a hybrid of a node system and a pose system. The base abstract interface is IMotion; every other "motion provider" derives from this class. For now, the basics are covered:

1) Sources: Keyframe (for now, IK and Procedural are in the making)

2) Unary modifiers: Loop, Mask, ScaleLength, SpeedChange, TimeRange

3) Binary modifiers: Blend, Transition, Add, Subtract


The nice thing here (I know it's not unique, but it's nice none the less) is the ability to load and play entire blend trees with 2 some lines of code:

IMotion* myMotion = ScnMgr->loadAnimTree("someTree.anm");

myActor->playMotion(myMotion);


That' s where the GUI tool comes in (to simplify the whole process). The ideea is that you can import keyframes from a wealth of (somewhat) standardized sources (.x, .b3d, .bvh, .smd) cut up the skeleton and frames and place them on totally unrelated (but compatible skeleton-wise) meshes.

Right now I'm undecided on what RAD to use for the GUI. The preliminary version was written in Delphi 7 but it's quite old and not really the looker (especially under Win7).

Tuesday 2 June 2009

Animation and Rigging

Ok, my last post was full of some feelings I've wanted to let out for quite some time. Now for the real posting.

Now, I don't know how many of you have heard of auto-rigging. It's basically a broad term for covering various ways of extracting/ embedding a skeleton in a mesh with no other information but the mesh itself and (at most) some scarce data on the skeleton.

The math behind it is if not huge, at least daunting, and not wanting to end up with no results at all I decided to expand on someone else's research. This is where (Pinocchio) comes in.
While all high accuracy methods require a "closed manifold" (basically a triangluated, fully-closed, caged mesh), this library (quote) "when presented with, for example, an unfamiliar quadruped character, can immediately execute commands such as "make it walk like a dog." To achieve this, we need to be able to embed an existing skeleton into the volume inside a character mesh, and then to attach the mesh vertices to the bones of the embedded skeleton. To our knowledge, this has not been previously attempted."

Now as their page says "The library is distributed under the GNU Lesser GPL and the demo app under the MIT license". So with that knowdlege in mind I went ahead, downloaded the library and started working on an Irrlicht-based animation package made up of a tool for rigging characters with predefined skeletons (using aforementioned library) and some classes to be used for (Blended Keyframe and, hopefully, IK and PhysX-based Procedural Animation).




The tool won't be limited to that alone, being useful for reasigning joints of already-rigged meshes to functions within the system and, if made up of different, separated meshes assigning them to joints (the first example that comes to mind is an armoured character).



Of course that the tool will be published under LGPL as well (since it uses Pinocchio) and anyone interested will be able to take a look at the code, but before that a google-code project will have to be set up some missing functionality (skeletons other than a biped, eliminating uneeded leaf joints) and a large bug ironed out (new actor after rigging and saving one character creates memory leaks, crashes the tool).

Well this was part of a bigger project actually but there's not really enough manpower for it... But that is another story to be told.