BVH Motion Capture Export

Blender has had BVH Import since 2006, But since there was no exporting blender couldn’t be used for cleaning up BVH files, or as a MoCap editor.BVH Support
This is significant because, unlike mesh formats there are few well supported formats for moving armature animation between applications.
Until recently with FBX/Collada there was no support for exporting armature animation out of blender at all.

The other day I was contacted out of the blue by Andrea Rugliancich with a working BVH Motion Capture exporter for blender 2.49.

After some emails back and forth we I was about to accept the patch and also ported it to 2.56.

This was based on a script I started back in 2005 but never managed to finish, logically I couldn’t see why it was so complicated since I’d written a working importer but eventually I gave up and put the script online.
Since then I’ve seen a few modifications to it but none worked correctly.

So thanks to Andrea Rugliancich, for finishing a script started 6 years ago 🙂

PS, I realize blender needs many other tools to really be useful for cleaning up mocap data, but many of these could be written as scripts.
Probably the trickiest think is a good work-flow for re-target one armature to another, so as to be able to import a BVH and apply to an existing rig.

– Campbell (ideasman42)

9 comments 9,576 Views
  1. Amazing, these are key features to make more really cool animation in blender, many thanks Camp!

  2. Looks very interesting! “there are few well supported formats for moving armature animation between applications” totally true!

    Sorry about the dumb question, I was working with .bvh imports recently and looks like it’s not possible to associate the skeleton with blender meshes (rig) … Is it right?

    Well I need to play a lot more with bvh specially because it’s very simple to set up the new origin for armatures 🙂

  3. I’ve been hoping for this script to be working and in blender for years… and it’s here!! Thank you Andrea & Campbell. I REALLY cant wait for the tools to clean up the imported animations, but this is a great start!

  4. Thanks Andrea and Campbell! This all goes beautifully in the right direction. I hope you and other people going for the development of this MotionCapture pipeline.

    I am freelancer working with MotionCapture data all the time. Well, I still need to use MotionBuilder (License is covered by the studio I work for).

    My steps are following:

    1. Multiple import of BVH files onto existing skeleton with bone measures of the performer (every imported motion appears as a take/action)

    – It would be great, if importer/exporter would swap unknown joints in hierarchy, so the character could have more spine joints and tails, or wings

    2. Cleaning hip or root joint of the skeleton with filters and manually in IPO Curve editor

    3. Baking/Plotting skeleton animation onto a Control Rig to be able to animate and clean parts like arms and legs separately (Sintel AutoRig?)

    4. Baking/Plotting back animation onto skeleton

    5. Export BVHs single or multiple with names of the takes

    If developers need character or BVH material for testings, please let me know. As I am not programmer myself (unfortunately 🙁 ), I am happy to help you out with anything else you might need!

  5. Very interested in seeing where you are going with this.

    I wrote a very simplistic script to change the rest position on a bvh rig imported with quaternion rotation.. I’d post the link but BA is down at the moment. It was very basic just subtracting out the quat difference between the new rest pose in frame 0 and then applying it as the rest pose.. It worked fine on CMU bvh files with different rest poses.

    Since then a few mails have come my way asking for help. Without investigating it too much and applying some matrix maths that may be required, I noticed that where it blew up was where the rotations were outside of -180 to 180 degree range. I had a quick look at the code of your importer for 2.56 and was thinking of replacing the angles with atan(tan(angle)) to keep the angles within that range and see then if my change rest pose script.

    I’m also in the very early process of a retargetting script.. but am on hold wth that a little because of the hold up with changing the rest pose.

  6. The bvh importer is still far away from professional needs. MotionBuilder needs less than a second to import a bvh file, when Blender is far behind with 17.4 seconds. The script will need a proper tune-up to compare. MotionBuilder does not use Quaternion rotation, there is no need, as Euler locks arent an issue for existing data.

  7. I appreciate you sharing this article.Thanks Again. Really Cool. eefeeeebdkdb

  8. Do you know of any scripts or Plugins that can directly export bvh to other animation softwares like Maya, 3ds max etc? I have a lot of animation data to be exported. Any help appreciated..

  9. Any DL link?!?

  1. Leave a Reply

    Your email address will not be published. Required fields are marked *


share this story on