BVHReader

Hey guys!
I have been working with moCaps, and most moCap research databases are in BVH format. I was converting it all in MotionBuilder, avoiding to write my own BVHReader. But in order to scale, this was unavoidable.
So I have written a very simple BVHReader (read only, no intention in writing a writer) for the most common BVH cases, which are: only root has translation and rotations, joints have local rotations.
I have made the code available in my fabricUtils extension (https://github.com/gustavoeb/fabricUtils) although it has no dependencies (aside from the sample file) on the rest of the extension. So it is easy to rip it apart from the rest.
Hope this can be useful to other people.

Best regards,
Gustavo.

Ps: Here are some databases you can try:
CMU (https://sites.google.com/a/cgspeed.com/cgspeed/motion-capture)
MPI (http://ebmdb.tuebingen.mpg.de/)

bvh.JPG 134.8K

Comments

  • EricTEricT Administrator, Moderator, Fabric Employee Posts: 300 admin

    Awesome stuff! Thanks for sharing.

    Eric Thivierge
    Kraken Developer
    Kraken Rigging Framework

  • Gustavo BoehsGustavo Boehs Posts: 59 ✭✭
    edited October 2016

    A little update. I have implemented a simple retargeting solver for transferring the motion from the BVH files to whatever other characters one has in place. All it does is reading a JSON file with a MotionBuilder naming conventions and transferring rotations (+ global character pos). But this structure could then be used to support more complex stuff like variable number of spine and neck joints, eventually.
    At the moment no technique for automatically dealing with scale and footskating has been implemented. To avoid such effects one has to dial in an appropriate scaleFactor.

    There is a file in the samples directory using motion from the CMU (https://sites.google.com/a/cgspeed.com/cgspeed/motion-capture) library and a character from the SMPL (http://smpl.is.tue.mpg.de/) project, but one has to download the appropriate files from this sites. JSON files with naming templates are also located in the samples directory.

  • borjaborja Administrator, Fabric Employee Posts: 470 admin

    This is very cool @Gustavo Boehs Keep it going!

    Borja Morales
    Technical Product Manager
    Fabric Software Inc.

  • Gustavo BoehsGustavo Boehs Posts: 59 ✭✭

    Update: Motion is now rescaled based on height difference between characters. Before this one had to guess a scaleFactor that would minimize footskating. This does not removes footskating altogether, but reduces it.

  • Gustavo BoehsGustavo Boehs Posts: 59 ✭✭

    A footStep solver has been implemented. If foot height and speed are below a certain threshold the foot Xfo is constrained in position. This is very simple and scene dependent (requires tweaking the values).

    I have tried to implement it in a way that would be Kraken compatible. It is a very simple solver that returns the foot Xfo and an isConstrained property. I haven't implemented any leg component using it, for I don't have a use for such component at the moment.

    I have implemented a very rough leg component in canvas though, and it is in the samples folder of this repo.

    In the animated gif you see an animation with drawDebug on, where dots represent constraints and lines are distance to ground.

    step.gif 732.4K
  • Paul DoylePaul Doyle Administrator, Fabric Employee Posts: 226 admin

    great progress! :)

    CEO at Fabric Software
    Twitter

  • Gustavo BoehsGustavo Boehs Posts: 59 ✭✭

    Hello guys, I would like to note that along with other relevant changes to this repo I have updated it to work with FE2.4 and its new RotationOrder. If anyone needs the old behavior please check the comments in KL\BVHReader.kl.

  • StephenTStephenT Fabric for MotionBuilder Posts: 75

    Hi Gustavo,

    This awesome - thanks for sharing!

    Whats the license like for using this? Attribution/OpenSource/Free-as-in-beer?

    Thanks!

  • Gustavo BoehsGustavo Boehs Posts: 59 ✭✭

    Thanks Stephen. Feel free to use it, change it, redistribute it... no limitations apply.
    Cheers

  • StephenTStephenT Fabric for MotionBuilder Posts: 75

    Merci Gustavo - your a champ :smile:

Sign In or Register to comment.