Importing a BVH file into Blender Reevan McKay's BVH Python script...

Back to SysAdm's Home Page

What is a BVH file?
Just give me the .blend files



BVH file - Biovision Hierarchical motion capture data (.bvh)

A .bvh file is nothing more than a text file that has data that was captured from a moving skeletal system. Another name for this type of data capture is "Motion Capture" which has been abbreviated as mocap. A .bvh file can be made by software or by hardware. Most studio houses that do their own commercial animation have their own type of motion capture technique.


The .bvh files that I will be using were obtained from a company that uses a type of Optical Motion Capture to make their files. I also use some .bvh files made from a software program called Poser. Poser is really easy to use and you can setup your own animations in minutes. You can then export as a .bvh file and bring them right into Blender.

Below is a section of a sample .bvh file. The file has basically two main parts...
The hierachy breakdown of the skeletal system used, and the actual coordinates of the individual movements.


HIERARCHY
ROOT
Hips
{
OFFSET0.000.000.00
CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation
JOINT
Chest
{
OFFSET0.004.210.00
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT
Neck
{
OFFSET0.0017.080.00
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT
Head
{
OFFSET0.003.970.00
CHANNELS 3 Zrotation Xrotation Yrotation
End Site
{
OFFSET0.003.230.00
}
}
}
JOINT
LeftCollar
{
OFFSET1.0214.861.71
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT
LeftUpArm
{
OFFSET5.450.000.00
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT
LeftLowArm
{
OFFSET0.00-11.290.00
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT
LeftHand
{
OFFSET0.00-8.340.00
CHANNELS 3 Zrotation Xrotation Yrotation
End Site
{
OFFSET0.00-6.130.00
}
}
}
}
}
and so on and so forth.... until all parts of the skeleton system are listed


Second part of the .bvh file :


MOTION
Frames:
181
Frame Time: 0.033333
-79.4532.90-54.3213.26-8.6258.54-2.018.333.7015.6752.96-17.39
-5.86-54.27-2.88-16.860.009.6334.926.52-38.180.00-28.56-14.16
12.251.716.2122.695.10-13.25-34.060.8826.780.00-21.483.78-5.11
-2.05-0.52-1.3522.321.34-3.083.676.41-4.91-16.45-0.051.5824.620.25
2.740.47-5.412.91-15.53-0.33 -79.4432.90-54.3213.30-8.6158.64
-2.068.393.4915.2752.85-17.35-5.05-54.30-1.82-16.870.009.6234.91
6.54-38.120.00-28.55-14.2012.311.656.2722.485.11-13.00-33.630.84
25.880.00-21.114.20-4.66-2.61-0.49-1.3222.371.33-3.113.496.11-4.90




You'll notice I highlighted in red what the different names are of each component of the skeleton system... This is VERY IMPORTANT in order for the Python script to work properly. You will have to name each EMPTY that makes up your Blender skeleton exactly like the names in the .bvh file.


Notice in the second part right after MOTION there is the number of FRAMES that make up the animation. Make sure you change Blender 's number of frames to match this in Blender's Animation Window.


Well that's about all there is to a .bvh file... now on to the next step...