BVH 4 BLENDER first release !!!

Hello everybody,

I’m pleased to announce the recent release of a brand new BVH tool for Blender
It is a script which create an armature based on a heap of empties and
it makes this armature’s bones follow the empties…

It is NOT an import script such as the ones of Reevan McKay and Bob Holcomb.

Main differences are:

  • There’s neither parent-children relationship between bones nor TrackTo constraint on bones
    (in order to avoid deformation when the armature is linked to a mesh)
  • You have to use the BVH import function of Blender before using the scrit

You can download this script here

To use it:

  • Import a BVH file into Blender (File->Import->BVH)

  • Initialize 3 variables (which are at the beginning of the script)
    startframe : the number of the first frame of your anim
    endframe : the number of the last frame of your anim
    hipbonename : the name of the root empty

  • run the script (Alt-P)


PS: Sorry for my poor english …

Nice, and if a self-register info and a GUI are supplied, it should be more nice.
I also suggest to add a simple “print ‘END’” at the end. Sometimes, I get “Warning, removed zero sized window from screen 2-Model” then the script halt, don’t know it has processed all the data or not.
It is some slow. To comment out “print vec, vec2” and to replace “if bo != None:” with “if bo:” can speed up a little.
Bug report: when animate the 3d window, frame 1~30 is ok, then the arm and hand bones do not move with the dot-line linked thingy. The bvh is here.

Thank you for your post …
It gives me the feedback I was dreaming of

Concerning the fact that the script is slow, it is due to the fact that I didn’t optimize it so far. I got the script working yesterday and I didn’t take time to enhance it. I only focused on the main functionnality of it.

Concerning the GUI, I will find inspiration on some other script … I hope it won’t be too difficult to do

Concerning the registration, apparently, to register the script, I only have to add a specific header to the script …

Concerning the warning, I’ve never encountered such behaviour …

Concerning the act the the armature stop moving at frame 30, I’m surprised … Are you sure you set up the “endframe” variable properly?
I imported your BVH file and I had no problem with it …

So … let’s sum up what I have to do:

  • Remove the useless output
  • Print “End” when processing is done
  • Simplify conditions on bone
  • Optimize the script
  • Make the script “registerable”
  • Add a GUI

I discovered Blender and Python about 2 month ago … So I don’t already master all these stuff … but I’m gonna enquire

Jean-Baptiste …


Indeed, there’s a problem with my script and your BVH …

the shoulder bones doen’t move right

I’m gonna explore this problem …

Cool script :smiley: Thanks !

Hi Oyster and Mr NightMare

I corrected the bug, added a GUI, removed useless output and attempted to make a registrable script.

The last release of the script is HERE

The script is not yet optimized … It is next step …

Thank you for your comments and remarks …

Jean-Baptiste PERIN

PS: Oyster, the script now works with your BVH file :wink:

The lastest release for Blender 2.37 is here

and the planned release for 2.40 is here. This one is a bit tricky to use … so I wrote a tutorial explaining a method for bvh manipulation with Blender 2.40

here’s a demo anim:


Hi jbperin
I’d like to thank you for this awesome script.I’m very interested in your CD3
After i import the CD3 file in Blender,how do i add an Armature?
Do i go about it the same way in the BVH tutorial,or is there another method?
Thank You in advance :slight_smile:

Hi tomiko

For now. if you want to build an armature on C3D import, you have to do it manually … for created emties do not form a parented structure as they do after a bvh_import.

I was thinking of modifying this script to make it buid a parented structure as bvh_import does … so that bvh2arm could be used following that script too…

But it turns out that bvh2arm has became somewhat "useless "since 2.40 RC1 (I even wonder if it’s gonna be included into official 2.40)
The interest of this script is undoubtedly vanishing with time …
there remains 2 options:
-Building Armature directly (when Pose module will be written)
-Carrying on building empties and make a bvh2arm that works with parented armature

For now … none of this solution is feasible … until the Pose python module is released.
So I’ll use this time to collect users’opinion and remind the math behind the stuff

By the way … which of the two options seduce you the more ?

thank you for your feedback …


Thanx for the quick reply.I guess i’ll play around with it for a while.I’m really interested in both scripts but the BVH of course does the job.
The CD3 files have more interactions ‘2 characters’, but BVH files will do.
In case your wondering,i’m not on a project, i’d just like learn more of what Blender can do, but Thank you for your time and patiance.

Keep working with these scripts.I’ve played around with BVH4Blendv1.0 and i found it interesting.As a matter of fact,my first model was done using that script :slight_smile:

In Blender 2.40 Using the “Import Motion Capture(BVH)” Import script, I get a pop up error message telling me to check the console. When I do, the console says:

Using Python version 2.4
‘import site’ failed; use -v for traceback
Traceback (most recent call last):
File “<string>”, line 82, in ?
ImportError: No module named string
Traceback (most recent call last):
File “<string>”, line 82, in ?
ImportError: No module named string

… This is me trying it a couple of times. Any clue as to what I am missing? Do I need to add somthing to the script or use an older version of blender?

It means you don’t have a full python installation on your computer. Blender 2.40 uses python 2.4
Once you’ve installed that you should be ok.