bvh "retargeting"?

Ive got a bvh mocap file.
How can I “port” the data to my humanoid skeleton?
I think the process is called “retargeting”. Can this be done with Blender and what is required? Do i need to have the same bone names and the same amount of bones on my skeleton?
thanks

I think it is much faster and more reliable all around to simply import the bvh and fit the bones to the character. Do not rotate the bones and do not scale them in edit mode. Simply make sure your character has the T pose you need or what ever pose your BVH comes with.

What you can also do is use your existing bones to pose your character to match the T pose of the bvh armature and then apply the armature. Then skin your character in these new bones.

From here on this set up pays off because now you can simply load in a new BVH file and delete the armature. Then swap out the actions. This is a very simple and reliable way to re-target in Blender.

Here is a thread worth reading:

http://blenderartists.org/forum/showthread.php?t=201749&page=1

Also I wrote a tutorial on this subject for 3D Artist magazine ( issue 24)

Hi

to follow on from what Richard said… if your original rig is from makehuman then there are retargetting scripts set up for that http://blenderartists.org/forum/showthread.php?t=204615&p=1754923&viewfull=1#post1754923

If your rest pose matches that of the bvh then renaming your bones will give reasonable results… otherwise don’t worry.

Also you can only swap in and out your animations if the bones and rest poses of your bvh’s are the same. I’ve seen cases where two mocaps from the same source have different bone rolls on the rest pose making the result crap. If you are going to use a lot of bvh’s then use a repository of like mocaps like at https://sites.google.com/a/cgspeed.com/cgspeed/motion-capture. I have been playing around with these and have a script to change the rest pose of the mocaps to the T-pose that is in first frame of these releases. http://blenderartists.org/forum/showthread.php?t=209131

Another way to go is if you have IK on your rig then constraining the hips to the mocaps hips and then using location constraints on the hands and feet (assuming they are your IK controllers) can give reasonable results also.

Good luck.

I think it is much faster and more reliable all around to simply import the bvh and fit the bones to the character.
Everyone can come up with that, lol. Its not an option, I already have all my models rigged with my skeletons. I already have all the weights assigned. This would mean redo all that. Plus, when I say character, i dont mean humanoid. Just bipedal. The armature created by bvh can simply not “fit” on some of them. See the red guy here: youtube.com/watch?v=ouFhpA6TERc&feature=related
And finally, this: wikipedia.org/wiki/Hand_Over
The skeletons in most mocaps dont have fingers, right?
These were they reasons I could think of off the top of my head.

The method you talked about in the thread of importing them as empties instead and assigning the empty transforms to the bones sounds like real “retargeting” though. How can you do that? Would you make the bones children of the empties?

^ didnt notice the above post
Hi,

If your rest pose matches that of the bvh then renaming your bones will give reasonable results… otherwise don’t worry.
Yeah, both t-pose. What do you mean “otherwise dont worry”? Should i worry if they do match then, or was this a typo?

Also you can only swap in and out your animations if the bones and rest poses of your bvh’s are the same
what do you mean by ‘swap in and out’ and “only”?

Anyway, how to do it? copypaste the IPO curves?
I think im gonna be lucky to make my own mocaps soon.

read bother for worry.

If all the bvh’s you import are the same rig/rest pose … once you have rigged your model however for one… you can import any other bvh in the set as an action and swap it in and out using action/nla editor… and IPO curves… makes me think you are with 2.49 … strongly suggest moving to 2.5+ the sooner the better imo.

I gave so many reasons why I dont want to rerig my models :no:
So does Blender allow “retargeting” or not?

1 Like

First Off, I agree with you… BVH is not useful unless it can be applied to existing rigs. Applying the BVH’s skeleton to your mesh is a quick and dirty way of proving a concept, but it is not practical if you wanted to do something real with your animation.

However, I am not sure you mean what you are asking when you ask about retargeting.

First, you will probably want to bring the armature in with the BVH file and use it as a target.

In a BVH file, only the root “moves” – and the root is usually the hips… so, what batFinger is telling you is quite correct: If you simply make your rig’s root constrained by the hips of the BVH then your rig will move with the BVH armature. If you also set your hands and feet to use the hands and feet of your BVH armature as targets, then they too will move – and if your hands and feet have IK constraints, these in turn will move your arms and legs.

As for retargeting… I don’t think you mean that. I think you mean: “Can I use the motion from a BVH file on multiple rigs” and the answer is yes, but it has nothing to do with BVH. Search for: “Motion Clips.”

You can save any action out as a motion. Then that motion can be applied to any rig – as long as the bones are named exactly the same.

So, theoretically, you could simply rename your rig’s Bones to be what the BVH is expecting, and then you can apply any BVH’s motion clip to your rig – to a point.

The problems with BVH are legion… for one thing, the sizes and ratios are a concern. If the BVH was captured from a small Asian woman, and you attempt to apply it to a super hero man, the motions will be all wrong, because the proportions are off.

Also, the rest pose becomes an issue. This is because ALL of the BVH movements are based on the rotations of the bones per frame. If the BVH rig starts in a hands down position, and your rig starts as a T-Pose then all of the rotations will be off.

The other problem with BVH is that most of the stuff that is readily available on the web is not very good. Many of them were captured as part of a learning experience for college students with home-made rigs. These don’t record movement very cleanly - you will see this especially in the feet which have a tendency to slide with the BVH files.

So… yes, you can get some decent results with BVH files… but you cannot duplicate in Blender what motionbuilder can do. At least not today.

hi

Why not? bvh is used by preofessional studios isnt it? Im going to record my own bvh’s, so whats the problem here?

However, I am not sure you mean what you are asking when you ask about retargeting.

When you have a rig with different proportions than the bvh rig, the transform of each bvh bone is applied to the corresponding bone in your rig. I think in Lightwave you can set which to which. So you could use a bvh on a King Kong model which has comparabaly larger arms and shorter legs.
The program I have for recording mocap uses local coordinates for each joint, so I dont see why the proportions (lenghts) of the bones matter.

As for retargeting… I don’t think you mean that. I think you mean: “Can I use the motion from a BVH file on multiple rigs” and the answer is yes, but it has nothing to do with BVH. Search for: “Motion Clips.”

couldnt find anything.

The problems with BVH are legion… for one thing, the sizes and ratios are a concern. If the BVH was captured from a small Asian woman, and you attempt to apply it to a super hero man, the motions will be all wrong, because the proportions are off.

Same as above, if coordinates are local, why should sizes matter. Rest rotation do, I agree, but if the coordintes and so transforms are done on local coords, how is this an issue?

Also, the rest pose becomes an issue. This is because ALL of the BVH movements are based on the rotations of the bones per frame. If the BVH rig starts in a hands down position, and your rig starts as a T-Pose then all of the rotations will be off.

Im lucky here.

The other problem with BVH is that most of the stuff that is readily available on the web is not very good.

gonna record my own.

Wow… you need to stop being so defensive… if you re-read what I posted, I think you will see I was not saying that you shouldn’t use BVH motion, but rather that being able to apply it to your own rig is essential.

Sorry… they call it motion clips in Messiah… for Blender you want to search for actions and NLA editor.

Nothing like that exists in Blender. (Nor Lightwave, for that matter…) The best 3D apps for using BVH are XSI and, of course, MotionBuilder.

You might have a look at: Jimmy|Rig if you have LightWave already… the project showed a lot of promise, though it seems stalled of late…

Don’t have time to discuss geometry here… But, you seem to have all of the answers, so I guess you don’t need my help anyway.

Good luck!

Wow… you need to stop being so defensive…
What are you talking about? I just want to know why it is like that. I could use smileys in each line like this :smiley: but I thought I was pretty neutral.

Don’t have time to discuss geometry here…
What geometry? Im talking about the bone transforms and local/global coordinates of those transforms.

But, you seem to have all of the answers, so I guess you don’t need my help anyway.
I dont if I knew i wouldnt start a topic to tell how much I knew.
Im just saying how I know it and ask if its true.
If you dont know, dont reply. I reply to answers asking for a bit more info, it doesnt mean Im 'defensive", whatever that means here.

I have recently worked on opening up MakeHuman’s mocap tool (which batFinger refered to above) for general, user-defined rigs. At least it works for Sintel, see http://makehuman.blogspot.com/2011/03/mocap-tool-for-custom-armatures.html. It should also work for most straightforward rigs, but if it may fail if there is too much going on under the hood.

The target rig must be in T-pose, and the source rig must be compatible with one of major free libraries found on the net. At least for now.

Hi
That looks like a cool script, but I dont think i understand exactly what it is.
Is it for makehuman, blender 2.4 or 2.5? What does it do?

----------------------------------------bvh to armature from kinect
import the bvh from kinects

first get a bvh that armature will be used
then get mesh in the “reset postion”(go to properites in armature)
dont rotate anything in the reset position
get the mesh in the reset position. use the morph shape if need to with another armature to
get it right
with the shape key set to the position of the reset position you are ready to parent the mesh
put back in pose position and you can now use bvh

do not rotate the bvh armature bones in reset or you will screw up the bvh look when play

then you can use actions after u import bvhs in and use that. i only tried with kinect seems to work well retargeting achieve. ask me any questions about this

i dont get it

The script, which is implemented as an add-on for Blender 2.5x, reads a bvh file and retargets the motion to an existing rig. It was originally written for MakeHuman’s (or mine, really) MHX rig, but in the last few weeks I have tried to open it up for other rigs as well. As you can see in http://vimeo.com/20651164 and http://blenderartists.org/forum/showthread.php?t=210858, retargeting now works at least for the Sintel Lite rig. Which is not so trivial, since this rig has non-trivial roll angles, leg IK, mixed quaternions and Euler angles, and bones which depend on others through copy-transform constraints.

Documentation can be found at http://sites.google.com/site/makehumandocs/blender-export-and-mhx/mocap-tool. It is rather up-to-date, except that it only talks about the MHX rig. For custom rigs one must also declare what the bone names are, cf http://makehuman.blogspot.com/2011/03/mocap-tool-for-custom-armatures.html .

I guess i should update to 2.5

Where is the link to the modified script? :smiley: or will the one for makehuman just work?

I sure hope it works for my rig.
I only have ik for arms and feet

I finally switched to 2.5!
And I got the script, but it seems to only import .mhx files, not .bvh…

bump______