Skeleton Animation and collision. Includes example with scripts.

Hi.
I was just learning the Blender Api and an idea came in my mind.
Take the deformed object. Find the vertexs tha are grouped with bones for deform. create Convex Hull objects from those vertexes. Parent the new Convex Hull with the proper bones in Rest Position. Bake the animation of the convex hulls. conect the action of the deformed object in logic with the convex objects to sichronized. make the convex objects invisible. run the game.
As you can see it is very complex. I created litle scripts to make this a litle easier.
You must have in your script dir the Convex Hull script by Michael_S you can get it here : http://members.fortunecity.de/pytablet/
Here is a done test that includes my scripts :
TurboUpload : http://d.turboupload.com/d/1347543/BakeSkeletonTest.blend.html
RapidShare : http://rapidshare.com/files/8296899/BakeSkeletonTest.blend.html

Press Key p in the 3d View to see the results.

How to use it : First of all it will take much time to play with it.
Select your skined object and run BakeShape script. This will create the convex hulls for every bone. After that you must set the skeleton to rest position and parent the proper Convex hull to the proper bone ( some time the new convex hull objects will have diferent agle usual 90 degrees in x axis reposition it to be ok ) after that you have to run the script BakeAnim.
From now on it comes the work that you have to done by hand. You must sichronize the action of the skeleton with the ipo animation of the convex hulls and make the convex hull invisible. Then you are ready to play. Also keep in mind that with bake anim you will still have the original convex hull and a duplicants in another layer. I sugest to move the first convex hull in another layer too, I just keeped then in the shame to make the parenting with bones easier.
I know that it is to much work to done something like this. In future bullet may provide something like this and with Ogre integretion the access to the bones may be possible.
Also in future there will be a way to parent throu python objects to bones so it will be more easier. If there was a way to add logic bricks with python this was going to be automated but right now this is how it is.

nice job!!!

Can’t download the file…

James XVI : I just downloaded. You just have to wait a litle bit to get the files from the free file hosters. Anyway … a RapidShare link : http://rapidshare.com/files/8296899/BakeSkeletonTest.blend.html

From what I read, this means that you have to record the ipos first, so its not a realtime simulation?

blendermf : It is a real time simulation. I just need a litle testing to see where I have to parent the new collision Objects to folow the skined one.

I am suprised I thought that it was something good. An aditional way to do it before the original suport. I may have to create a better demo but I will wait for the new vertion of Blender.

I also couldn’t download from that site… i just get a servor error…

Wow that’s nice. This could save a lot of time in a game with animated characters, thanks for the script = )

I know it uses the physics in realtime with the Convex hull, but does this mean you could only use it for prerecorded animations, not say realtime ragdoll simulations in the previews