Jump to content
Atom

BVH Tweaker For Carnegie Mellon Motion Capture

Recommended Posts

Hi All,

I have been working on a python script that will tweak the rig generated by the .cmd file produced by mcbiovision. Specifically the Carnegie Mellon University Motion Builder BVH files.

The script modifies the Carnegie Mellon University Motion Builder rig to allow extended functionality such as adjusting the length of various bone chains in the rig. The script also has a tool to mirror bone lengths from the left to the right side of the rig for symmetrical bone lengths. There is an origin offset control to align the start frame of a clip to the world origin. There are two preset bone configurations for male and female skeletons as well as full rotation control for most bones in the rig. I demonstrate the steps to capture/skin the mesh geometry and extend the capture ranges using the Auto Weights tool which is part of the script. I show how to extend the capture weights of each bone to achieve full deformation coverage. The end result is a fully skinned dancing person.

The python script itself is based on the artists concept of stacking eight head lengths on top of one another to form the full adult human height. This total length is then divided up by percentage for the arm, leg, torso and head lengths. The script applies these percentage to the original bone lengths captured using the scripts Capture Bone Lengths button. The length sliders modify these percentages to allow for adjustable bone chain lengths.

 

I put together a video to demonstrate it's use.

 

ap_BVH_python_tweaker_tut_end.hiplc

cmu_salsa_dance_mocap.zip

Edited by Atom
  • Like 2

Share this post


Link to post
Share on other sites

I like how good the rig guess worked for fitting the skeleton to the mesh! On fixing up the capture regions check out the http://www.sidefx.com/docs/houdini/commands/bonealigncapture command. The corresponding viewport tool is http://www.sidefx.com/docs/houdini/shelf/aligncapturepose but click on the link of the title below on usage:

Another thought while watching is that you can use the Capture Mirror SOP to mirror the weights so that you can avoid needing to tweak the capture regions for both sides. Or, I guess you can just add that mirroring to your script as well to mirror the capture region parameters as well as the bone lengths.

Share this post


Link to post
Share on other sites

nice. I'll have a look at this in the am

you might want to give Proximity Capture a try - you can avoid manually adjusting the bone capture regions.

how are you aligning the bones to the mesh?

Share this post


Link to post
Share on other sites

Thanks for the feedback Ed and Michael, I plan on looking into more of the capture tools.

The alignment button is a preset that happens to match the mesh I imported. The button code simply populates all the rotation and offset fields with values that match the imported mesh. This was my way to keep the video less boring. So you did not have to watch me align every bone. Once I had the bones aligned I simply wrote code to take those values and store them back onto the python script parameters. If you were to use this button on any other .bclip file, other than 61_11.bclip, the rig probably won't line up and will require further tweaking. But it is a way to get your bone in the "ball-park" area for final alignment.

 

Here is a portion of the code. You can see it just sets values...

def autoAlignFemale():
    # Some custom values that align the female skeleton to the CMU BVH t-pose for mocap 61_11.
    node_self.parm("head_size").set(1.0)
    
    node_self.parm("rig_offsetx").set(-20.28)
    node_self.parm("rig_offsety").set(1.9)
    node_self.parm("rig_offsetz").set(-0.1)
	zeroArms()
    zeroLegs()
    zeroSpine()
    zeroLengths()
    
    node_self.parm("tweak_upper_arm_leftx").set(3.22)
    node_self.parm("tweak_upper_arm_lefty").set(6)
	node_self.parm("tweak_upper_arm_rightx").set(4.89)
    node_self.parm("tweak_upper_arm_righty").set(-3)
	.
	.
	.
	
Edited by Atom

Share this post


Link to post
Share on other sites
On 20/07/2016 at 3:52 AM, Atom said:

Hi All,

I have been working on a python script that will tweak the rig generated by the .cmd file produced by mcbiovision. Specifically the Carnegie Mellon University Motion Builder BVH files.

The script modifies the Carnegie Mellon University Motion Builder rig to allow extended functionality such as adjusting the length of various bone chains in the rig. The script also has a tool to mirror bone lengths from the left to the right side of the rig for symmetrical bone lengths. There is an origin offset control to align the start frame of a clip to the world origin. There are two preset bone configurations for male and female skeletons as well as full rotation control for most bones in the rig. I demonstrate the steps to capture/skin the mesh geometry and extend the capture ranges using the Auto Weights tool which is part of the script. I show how to extend the capture weights of each bone to achieve full deformation coverage. The end result is a fully skinned dancing person.

The python script itself is based on the artists concept of stacking eight head lengths on top of one another to form the full adult human height. This total length is then divided up by percentage for the arm, leg, torso and head lengths. The script applies these percentage to the original bone lengths captured using the scripts Capture Bone Lengths button. The length sliders modify these percentages to allow for adjustable bone chain lengths.

 

I put together a video to demonstrate it's use.

 

ap_BVH_python_tweaker_tut_end.hiplc

cmu_salsa_dance_mocap.zip

Hi Atom,

Thanks!

Did you remove the script I cannot find it ;(

Share this post


Link to post
Share on other sites

It looks like it is there to me, try the link. The script is there, but not the tutorial. Vimeo capped my limit a while back.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×