Jump to content
Sign in to follow this  
Jason

Dops Challenge: Ragdoll Physics

Recommended Posts

Hello all,

This challenge is to automatically build full ragdoll physics for a rigged character by examining a character rig. Ideally the rig should support joint rotation limits and have customizable collision objects.

It would be great to utilize DOP HDAs to build sections of the a ragdoll rig to mimic joint types and such available in the character tools.

Perhaps start small and attempt to build a single two-bone chain and try to support collisions, then rotation limits and then consider what it might take to support an entire skeleton.

Let the ideas flow!! :P

Share this post


Link to post
Share on other sites

PS. I'd attempt this in 8.1 instead of 8.0. SESI have made improvements to DOPs constraints since then.

Share this post


Link to post
Share on other sites
PS. I'd attempt this in 8.1 instead of 8.0. SESI have made improvements to DOPs constraints since then.

I haven't looked at 8.1 beta yet but in 8.0 I don't see a way to limit and damp constraint rotations between certain angles. If I want a realistic range of motion in a ragdoll elbow or knee joint. I don't see a good way to do this. This is something we're currently trying to develop on a show. Any thoughts Jason?

Sean

Share this post


Link to post
Share on other sites
I haven't looked at 8.1 beta yet but in 8.0 I don't see a way to limit and damp constraint rotations between certain angles. If I want a realistic range of motion in a ragdoll elbow or knee joint. I don't see a good way to do this. This is something we're currently trying to develop on a show. Any thoughts Jason?

Sean

Some answers I've gotten in the past about this is that it might be better to build a small physical mechanism for these things - which would not be hard to do, considering OTLs make it very easy to do. I was wondering if anyone had figured out a neat way of using the built in constraints for limited hinges and such.

I'm thinking that perhaps a fairly workable idea might be to build a single bone with a hinge with this physical limit geometry and a spherical collision object and, via an hscript process, mimic the entire skeleton of the character. Ideally it would be great to have limits and damping on the current constraits (RFE'd to SESI already), and then a wholly procedural way of defining it to DOPs but I don't think we're going to get that for 8.1 (also RFE'd).

What to do next? Well, it seems a common technique is to constrain the dynamic skeleton to the real one by spring contraints, animate the real one and at some point release the springs and let the physics drive the dynamic one further. If things are named correctly then it might be possible to send the dynamic bone rotations back into Object-land with CHOPs, I'd assume, and then you're free to render the original.

This all just theoretical so far, mind you :)

Share this post


Link to post
Share on other sites

So here is an idea for trying to kick off this idea:

In this file is an embedded OTL which it trying to mimic the skeleton structure, and it works ... almost. I really hope that we can work this out as a team effort with some pointers from SESI.

Please take a look at it and see if it makes sense to you. This was built in 8.1 but I hope it'll load into 8.0 - or just install 8.1 and play.

Issues I am having:

*) Bi-directional constraints. I was having a hell of a time trying to set them up and it looks like I've done the right thing to me but in actual fact it seems to behave like one-directional constraint.

*) I haven't gotten around to building any rotation limit stuff into this because I'm trying to build this first-things-first.

*) As soon as I set the Solver to "Mutual" the collisions send it haywire. Something to do with the contraints not being truly bidirectional, I assume.

*) The Directional constraint for the bone angle - I'm not sure it's setting the axis relative to the target object's orientation. I think it's doing it in world space. I wish the guides showed some of these things more clearly.

I'm sure there are going to be a lot more issues with this soon enough but I thought it would be a good start to get us talking about it.

Cheers,

Jason

ragdoll_start.1.hip.gz

Share this post


Link to post
Share on other sites

Hey Jason,

What's going on man? Anyway Sean and I are both trying to get this rag doll stuff to work over here. Anyway I have included my first attempt. It doesn't have bones and the rbd settings are still out of wack and all but it is my first stab. The caveat for this is that we are going to have to figure a way to "pop" this doll into the correct animation position. for the beginning of the sim. (will be animated out side of houdini).

ragdoll1.hip

Share this post


Link to post
Share on other sites

Hey Jason,

I downloaded your file but when I open it i get a bunch of errors. I think the embedded otl is not being recognized.

things like:

Warning: Bad node type found: users_ragdoll_bone_v01 in /obj/dopnet1

Share this post


Link to post
Share on other sites
Warning: Bad node type found: users_ragdoll_bone_v01 in /obj/dopnet1

Damn... sorry about that. I'll attach a new one in the morning when I get in to work.

Share this post


Link to post
Share on other sites

Ok, here is a version with the Embedded OTL.

I would love to hear comments from people on the approach.. also if anyone knows how to fix the bidirectional constraints properly too. My time is limited over the next couple of days.

Mr.Zerouni? Mr.Tucker? Any hints come to mind?

ragdoll_start.2.hip.gz

Share this post


Link to post
Share on other sites

Hinges are best accomplished using a pair of position constraints rather than trying to use rotational constraints. Rotational constraints are much harder to visualize and control, and in this case you'd need to change the number of degrees of freedom, which makes them that much harder to use. Attached is a file which uses a pair of position constraints for each joint. The offsets (+0.25 and -0.25 in z) are hard-coded, but it should be possible to calculate them using the relative orientations of the source bones.

Another problem is that for constraints to really work, you need all your objects to be mutual affectors. So I turned on "Make Object Mutual Affectors" on the RBD Solver. Of course this means the solver does collision detection between the bones. If you play the attached hip file, you'll see that the bones all disappear (positions become NAN) around frame 73. I've reported this as a bug, but I'm sure it has something to do with the interactions o the collisions with the constraints.

If you want to avoid collision detection between the bones (and thus avoid the above-mentioned bug), you should still make the bones mutual affectors, but dive into the RBD Object, and the RBD Configure Object inside the Bone object. Then change the Collider Finder Label of colliderlabel2 to "Bone". This identifies the bone objects as type "Bone" for collision detection purposes. The RBD Solver doesn't inherently know how to collide Bone objects with other Bone objects, so it doesn't collide them at all. But it still knows the ground and sphere are Volume objects, and so collides with them just fine. Things become more complex if you then want to have objects in the scene that are mutual affectors with the ragdoll. You will need to teach these objects how to collide with Bone objects by attaching a Volume Collider as subdata to the Collider Label.

I hope this helps move things along a little more...

Mark

ragdoll_start.3.hip

Share this post


Link to post
Share on other sites

Ah, that is indeed helpful, thank you Mark.

I suppose it would be pretty useful to build a Hinge Contraint HDA from this to make easy to set up the axis of the hinge and so on.

I'll try and play about with this some more.

Share this post


Link to post
Share on other sites

Hey guys,

So this is what we came up with on our end for limiting range of rotation. The only thing it seems that the values are almost arbitrary. Anyway take a look.

dynamicJoints1.hip

Share this post


Link to post
Share on other sites

How I can make work "ragdoll_start.3.hip" on houdini9.5?

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
Sign in to follow this  

×