• 04May

    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?

    Contortion on the Beach

    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.


    Posted by Jacek Antonelli @ 1:19 am

3 Responses

WP_Cloudy
  • Paul Reitz Says:

    I’ve been looking all over the web for information on how to set up the bone system in Blender so that a BVH file exported from Blender will work with Second Life, and my search brought me here. BTW, there are already a couple of exporters for Blender. Would it be possible for you to share how the bone system should be set up? thnx

  • Paul Reitz Says:

    Are you still working on this project? I just spent all day yesterday rigging the avatar object in blender and using the blender motion kit to export a bvh file. I wound up with something similar to the picture you put in the article. I’ve noticed that the Y and Z axis are switched between Blender and Avamator.

  • BETLOG Hax Says:

    Any progress?