sharpdx/SharpDX — pull request #407 by jwollen (2014-06-03 19:01:01+00:00)
Title: [Toolkit] Model improvements and animation support

I recently did some work on the model pipeline and would like to contribute some of it to the toolkit.

The branch currently contains just the minimum fixes and changes needed to support skeletal animation.
Before doing anything major, I'd like to discuss what you would like to see, and what you feel is out of the scope of the toolkit.

A few pending changes, that I would like to introduce next, include

1. Separate data (```Model```) from state and rendering logic (```ModelInstance```). This would also make ```Model.Clone()``` unnecessary and integrate well with scene graphs.
2. Move transformation related logic into a ```Skeleton``` (and ```SkeletonInstance```) class.
3. Facilitate separation of meshes, skeletons and animations. Make it possible to apply animations and meshes from different models to matching skeletons.
4. Remove parameter setup and effect specific code from Model. This could be done using some kind of configurable ```EffectBindingSystem```, that automatically sets parameters when effects are applied.
5. Support animation playback. Should we provide a basic animation library or just a few helpers?

I'm not yet sure what to do on the compiler side of things, beyond some refactoring. Assimp poses some problems, when it comes to more advanced stuff (e.g. morph targets).
I feel like I would need to ditch it eventually, so I was debating whether I'm going to write a separate import library.
It would basically be a managed import-only alternative to Assimp, supporting only a few major formats and being more extensible and easier to maintain.
I might as well base it on SharpDX and the ModelCompiler and we could decide later if it fits the toolkit.

I also added a [SkeletalAnimation sample](https://github.com/jwollen/SharpDX-Samples/tree/model). Right now it references the Dude.fbx model, which Assimp doesn't import correctly, so the animation is a bit messed up. I'm going to add a model that is better suited soon.