3D Artist
Mar
24

Free Blender tutorial!

Tips & Tutorials
by
The 3D Artist Team

Top 3D artist Richard Culver explains how to import and retarget mocap files in Blender 2.5

Free Blender tutorial!

Blender supports importing mocap data in the BVH format. Importing is accomplished through a script: go to File>Import>Motion Capture (.bvh). When you select a BVH file, the script automatically generates an Armature object (bone rig) with the bone names and hierarchical relationships in the BVH file. The animation is stored independently as an Action (block of animation keyframe data) that is automatically assigned to the rig.

In order for retargeting to work well, the new target rig should have the same relationships as in the BVH rig. In Blender I have found that the fastest and easiest way to do this is to simply use a copy of the same rig. Editing a rig in Blender to a new character regardless of size or shape is a snap.

What I have found works well is to edit the character mesh into a T-pose that matches the BVH rig rest pose. This ensures that the animation will play correctly. Also any major scaling – say to the size of a mouse – should be done in Object Mode. Any other reshaping of the Armature object to fit the character can be done in Edit Mode.

Once this is done, we can take advantage of Blender’s data system to quickly and easily retarget any new Action data from an imported BVH file to the Armature of a character.
In Blender, an Action contains a set of keyframe data as a separate block of information that can be swapped from rig to rig. Also you could load BVH files, delete the rigs and have a library of Actions stored for use on any character.

In the following steps I will assume you have a basic understanding of rigging, weight painting and so on in Blender. I will only cover the steps related to getting your rig ready for use with mocap data.

And to start, depending on where you get your BVH files, it’s likely you will have to prep them first. One main issue – among others – is the sample rate. Some BVH files have way too much information – up to 120 frames per second (FPS). That makes working with the files far too cumbersome, not to mention noisy. We will start by preparing the BVH file for importing well into Blender with a free program called bvhacker.

Step 1

Free Blender tutorial!

Prepare the BVH file What we want from bvhacker, or any tool you choose, is to make the following modifications where needed: at Frame 1, there should be a standard T-pose with the model at rest. The hip (root) bone should be centred. And finally, adjust the Frame Rate FPS. Some files come with 120. I like to work with about 30. In bvhacker, use the Set 1/2 frames in the Edit menu as many times as you need to achieve the target rate.

Step 2

Free Blender tutorial!

Import and setup When you import the file, the rig will likely need to be rotated because in Blender, Z is up. Do this in Object Mode so that the Armature object stands up. Then line up the character to the Armature and vice versa. This is very much a back-and-forth process. For the bones, move them in Edit Mode. If a rotation is required, do that to the character limb, rather than the bone.

Step 3

Free Blender tutorial!

Retarget animation To retarget, simply copy this rig (or import a new BVH) and repeat Step 2 with a new character model. You only have to do it once per character and it is simple and fast. To assign a new animation to any rig, import a new BVH and that new Action will be available. Select the rig of your character in Object Mode and, in the Action Editor, simply choose the new Action.

………………………………………………………………………………………………………………………….

About the artist Richard Culver is a filmmaker and freelance 3D artist with more than 20 years of experience in all aspects of film production and postproduction. See more of Richard’s work at www.richardculver.com.

  • Sebastian

    Thanks a lot for this small but useful tutorial.
    although is like “cheating” to use mocap, is very useful and needed in many cases, like videogames

  • Miguel Salinas

    Thanks a lot for the info!
    We have winned a MOCAP gypsy 5 from animazoo and we can’t use so far with blender…
    But now we can try it!

  • http://lalamax3d.blogspot.com lala

    thanks, really valueable / useful information.
    If you wanted to write more in future, here is my suggestion , as i would like to read more… :)

    if my character is rigged ( constraints / IK ) setup-ed. then how would i re-target with imported skeleton.
    i can imagine, i would make feet controllers child of skeleton bones etc….
    but still lot of questions left for ideal / speedy production
    1- is there a way, we can define mapping ( script or tool or operator ) already exist…
    2- while retargetting motion on rigged ( constraints / ik ) controllers. is it possible to setup drivers, so foot rotation in mocap file, can go to rig foot roll parameter etc…
    3- once mapping is done, is there a way to bake that action data to new action ( which transfer motion and generate keys on controlled rig etc ..

    still thanks for this and for all future writings, cheers

  • Hans

    Nice tutorial, but a little few information.

    Any change for an detailed videotutorial?

    It is an so important feature.

    Many thanks in advance.

  • Dave Mahabiersing

    Hi Richard,
    thanks for bringing this tutorial as a kick off for using bhv motion data in Blender.

    I like to attach original asf/amc data CMU Graphics Lab Motion Capture Database http://mocap.cs.cmu.edu/ to the sintel_lite character http://www.sintel.org/news/sintel-lite/

    I use original asf/amc data to bhv with http://vipbase.net/amc2bvh/ and use bvhacker making the bhv in T position for easy attaching and importing it into Blender.

    So far these experiments ended messed up.

    Maybe I am missing something which is trivial for you so an extra detailed step 2.5 would be helpful.

    The problems I have is to add (I got the idea to have two armatures for one mesh) or replaced (removing the bones without destroying the character) an imported bhv armature to an already rigged character.

    I don’t know how to attach the armature to the mesh in 2.57b and menus have changed so video tutorials on the internet are not helping out.

    I have also problems when translating, rotating, scaling the imported bhv armature, there is a difference when switching between object mode and edit mode. The bhv armature in edit mode is on a different position compared to object mode.

    Some tutorials make use of the pose position and rest position buttons in the armature pane, but using these or not using these didn’t help either.

    Also how to handle action data and mixing them in an extra step 4 would clarify a lot e.g. what if you want use many different bhv data for one armature or switch between armatures each with their own action data?

  • Dave Mahabiersing

    I saw I made some typos: where I wrote bhv I meant of course bvh…

  • Pingback: Tutorial: .bvh Mocap Daten in Blender 2.5 verwenden at BlenderNation

  • Pingback: 教程:在Blender 2.5中使用bvh动作数据文件 at BlenderNation

  • Pingback: Tutoriel : Utilisation des données de motion capture au format .bvh dans Blender 2.5 at BlenderNation

  • Pingback: Tutorial: Używanie plików .bvh z mocapów w blenderze 2.5 at BlenderNation

  • http://www.youtube.com/user/Mike2008and2008 Mike2008and2008

    What do you mean by re-targeting? I use bvhacker to do the T setup and Center. Then import Wavefront OBJ
    into Blender 2.66a and BVH file. Do the rigging steps and parent the rig to the object using automatic weights. Then tweak with weight paint and/or vertex groups. Tedious but works. Is there an easier way?