Thursday, June 13, 2013

Retargeting BVH

This entry covers another method for incorporating Motion Capture data through a BVH file.  This method is useful for any circumstance, but is exclusively helpful when your BVH rig does not have a nice T-Pose in Edit Mode (as shown below).


This entry is a very basic summary of what is shown in this video here Video Reference

A huge database of BVH files can be found here:  MoCap Database

If you have a BVH rig with a nice T-Pose while in Edit Mode, you may want to use this approach instead  BVH Meshing




For the ease of explanation, the following naming convention will be used to differentiate between the BVH rig and your own rig:

Source:         Performer
Your Rig:      End User

The first step is to enable the Motion Capture Tools addon in the User Preferences.


For this example, I'm not going to create my own rig, but use the built-in Rigify rig, which is also in the User Preferences.  This is simple for the tutorial, but you may get better results creating your own rig.

After importing the BVH, and applying some scaling [S].  Add [SHIFT+A] the Human armature through the armature menu.

Adjust the scales so that the two armatures roughly match.

Since the process of retargeting involves matching bone names it is recommended to enable bone names on both rigs.

Select the Performer first, then [SHIFT] select the End User.  Now when you view the Object panel you'll see the the Mocap Tools section filled in with the Performer's bones.  This is where the mapping of bones occurs.

To get started, you can use the Guess Hierarchy Mapping button to fill in the bones that Blender can figure out on its own.  For the Rigify rig, it gets quite a few right.  The rest are manually mapped.

You can either click on the empty bone field and a list of available End User bones will display.  Or you can apply the following method.

Placing the End User in Pose Mode will allow you to assign specific bones at a time using the target icon.  Simply select the desired bone.

Then in the Retargeting panel, press on the Target icon for the desired Performer bone, and the bone will be mapped.

Once all the desired bones are mapped press the RETARGET! button and wait.  Once the retargeting is complete, review your rig to verify that there were no mis-mappings or other problems.  In my case, I had to un-map some bones because the difference in the way the bones were parented in each rig caused the End User to become deformed.  The spine specifically caused problems.

Another issue I ran into that seems to be specific to the Rigify armature is that a stride_bone is added as a parent to the End User and this bone was causing dramatic shaking, so I moved the metarig out from under it, and deleted the stride_bone.

The following animation shows the Performer retargeted to the End User, and both are animated in sync.  It's not a perfect mapping, and some extra tinkering is necessary, but this is the general approach.

2 comments:

  1. This only works for the Body what about the Face?

    ReplyDelete
  2. You're right, this tutorial focuses exclusively on the body, primarily because it's based on a video tutorial that was body-focused. I unfortunately haven't done any retargeting for face rigs.

    ReplyDelete