Over the past week, I’ve been working on a script to export SL-compatible BVH animations from Blender armatures/sketelons.
My motivation is that Blender provides a very rich toolset for motion curve editing, as well as the possibility of custom rigs (including IK). It’s certainly a major step up from QAvimator, which I’ve used for a few dozen still poses and a small handful of proper animations. I’m altogether spoiled by Blender with its charming ability to edit motion curves across time — on the other hand, if you could ask QAvimator if it does “ease-in and ease-out“, I bet it would just blush and giggle while mumbling something about ‘waiting until after marriage’.
The export script has been an off-and-on (but mostly off) project for well over 6 months, actually. There have been a number of challenges and things I had to learn about: Blender’s scripting API and internal structure, the BVH file structure, and a little bit of transformation matrix computation to boot. Plus, the script has to be written in Python. I was quite comfortable with Python when I was using it several years ago, but these days my native language is Ruby. (Comparisons between Python and Ruby are not very flattering towards our legless reptilian friend, I’m afraid.)
Regardless, I have made some solid progress. The code to output a passable BVH file that SL (and QAvimator) will parse is complete and functioning correctly. Rotation for the hip, abdomen, chest, neck, and head joints all appear correct after export. Unfortunately, the arms and legs are proving more elusive, as you can see in the image below. Investigation is still ongoing. The primary suspect is a disconnect between the rotation axes that Blender uses (e.g. y axis always points along the bone) and those that SL/QAvimator uses (e.g. in the arms, the x axis points along the bone).
It’s tough going, though. Maybe I should just call it a success and go in to the contortion animation business. Yoga on the beach, anyone?
P.S. I am as of yet undecided about whether I will distribute the finished script to the public, and if so under what terms.