I have been working on a script that will automatically connect BVH empties to a rig. I have had some success, but every single rig I have tried, over 5, seems to have binding and twisting problems. The concept behind the script is that it adds CopyLocation and CopyRotation constraints to the existing rig.
I have never built a rig, so I am not sure about how bones work exactly. But I think the driver system if fairly close to working. It only breaks in certain positions and I don’t know why. I am hoping a more experienced rigger might be able to take a look at the file and offer some suggestions.
I am attaching a simple ballerina animated rig to demonstrate the problem.
CHARACTER_xsi_style_rig_1c.blend (951 KB)
more information …
the imported bvh-data - imported as an armature and not as empties -
works? Or does it show the same twists?
I can’t look at the .blend file at the moment, but I am imagining animated empties located at a persons joints. Have you tried using a track to constraint instead of copy rotation? For instance, the upper arm bone would track to the elbow joint. That way if there is any odd rotation going on with the empties, it wont effect the rig.
Here’s my blend of it
I wouldn’t use a CopyRot and LimitRots, with IK, on the same bone. I removed the CopyRot and LimitRots, and it moves a little nicer. Does the script require using the CopyRot, CopyLoc?
I also find it interesting your bind pose is horizontal, which I’ve never seen.
I love to see your script I was think of doing the same thing. Try using 2.5 Itasc ik it has lots of advantages and controls… You would have to load the bvh in 2.49… I would love to try this with your script it is going to need to change for 2.5 isnt it… hmm anyhow would still love to see your script
@test-dr: I threw away the armature that came with the empites without really looking at it, but you may be right. Perhaps there is just bad mocap data.
@asano: I don’t have to use CopyLOC/COPYROT it just kind of worked so I kept going that way. I may try the TrackTo instead, that makes sense to me.
@mikhal: Your rig adjustments seem a little smoother. There is still a problem on the feet at frame 72. They flip completely backwards. Could this be bad mocap data? Is this a gimbal lock? The flipping seems to be related to crossing the zero threshold of a rotation. Like going from 359-0 degrees. A lot of 3D apps have problems with that.
@ibkanat: The script is in the posted BLEND file, feel free to have a look.
I would like something that just works with any existing rig. The script just pops on the COPYLOC/COPYROT constraints without actually analyzing any IK, Limits or other constraints that may be present. I think this where my ignorance of rigging is holding me back. The code could look at the constraint stack and skip or turn down the influence of other constraints that may interfere with the mocap driving technique if it detects something problematic. I just don’t know the rules for what is problematic constraints yet.
thanks… iTasc and 2.5 seems like it will solve allot of the problems that you are having. There are many many settings and I have just played with it but ben posted a very indepth wiki on blender.org So you might as well learn the new way. Its actually allot more intutive then before. One of the biggest feature is the ability to have more than one target for a bone. This means if I understand and I think asked ben about it. That you can create you own skeleton and then drive it with the mocap data.
I did a little test the other day and was able to quickly get it to get ok results. So the missing element for me was quickly setting up the constraints from a import of mocap. This is where your script comes in but it will need to change because of 2.5 but should be easy… In fact Ben in his wiki lays out the the needed info.
hey, i think i found the bvh-data-file: ballerina.bvh
if you import it with an armature, you will find some bit strange
settings, special around the neck. The animation itself is just nice
and looks convincing …
if i use my little script to put boxes at the armature, there are no twists
in the animation, but if i try to use the rest-position of the armature and
make some modifications (only adjust the sizes of the boxes), then
it soon shows those weird settings.
(this little script is in one of the blend-files in the thread of my signature)
Yep, that is the correct ballerina file. From Michael’s central source. I thought I would start with some of those dance files.
I am taking a look at some of your files…
only to make it easier,
the blend file, with script
and a bit modified boxes.
Generation has to be done with the ARMATURE in RESTPOSITION
simple only switch armature to edit-mode.
Then if you try to edit some boxes (its only one mesh)
special the neck-part, then it is easy to see
there is something going wrong. The captured animation
and the restposition are not what one would expect,
the neck seems to rotate to a different … way …
next - there is something i do not understand -
the bvh-data of the original ballerina-bvh has
Frame Time: 0.033333
and if i
use my bvh-exporter (script is in blend too, but it is still beta) to export
it again, i get a
Frame Time: 0.040000
but the import of this export shows no big difference(there are, shure!).
edit: i rotated the ballerine in x-axe 90 degrees to make her up the z-axis
ballerina_box_bvh.blend (311 KB)
Out of curiosity, did the track to work any better than the copy rotation?
@Asano: I have tried the TrackTo, but it has its own problems. Like fluttering limbs and if you don’t do a true CopyRotate on the hips, your character will never spin correctly. It is starting to look like a mix and match of constraints is going to be needed.
@Test-Dr: The ballerina box is nice, I’m not sure how to adapt it a rig, however…
It is a little closer. I went in and removed existing constraints on bones that were conflicting with the constraints I am attaching. The feet are still a little wonky. I was hoping not to have to “Doctor” rigs to make them work.
bvh_connect_GUI_design_1c.blend (971 KB)
maybe this is an usefull thread about problems with armatures and bvh-motion-captures.
(picture is from this thread, to show other problems - wheighting)
@test-dr: Thanks for taking the time to post those links. I have visited that thread in the past.
Part of the concept I am shooting for is to not have to deal with the character rigging or paint weighting at all. I just want to use rigs that already work.
I am in the process of working on a new button for BVH Connect called “Clean Rig”. What this button does is simply remove all existing constraints on the rig so they do not interfere with the new ones that my script is going to add. It is still a work in progress.