Jump to content
gramx

Breaking Ragdoll Constraints

Recommended Posts

Hi,

Just finished the crowds course on cgcircuit, witch I think gives a really good introduction to setting up your own crowd characters. Hope part 2 comes out soon.

https://www.cgcircuit.com/tutorial/crowds-for-feature-film-in-houdini 

Anyway I have been working on the sim now using Ragdolls and now partial Ragdolls. Here is a playblast:

https://www.dropbox.com/s/othdgdraazwxyn3/PartialRagdol_Hats.mov?dl=0

For the next step I want to break the constraint to the hats so that they fall off. In the help it says you can do this in the following SOPsolver node modify_ragdoll_constraints. Now this node does not get created anymore by the shelf tool, I am using Houdini 16.5 I have tried creating a SOPsolver and connecting it to the third input of the Ragdoll Constraints but get the following warning: This data is attached to an unexpected parent data.  

The help continues by adding this line to a primitive wrangle 

if (f@torque > 50)
    removeprim(0, @primnum, /* andpoints */ 1);

I have also tried adding this but nothing happens.

Anyone know how to fix this?

Thanks

Graham

 

image.png

Share this post


Link to post
Share on other sites

usually the constraints come close to the end of the whole dop network.

in your picture it looks like you have the contraints separate from the crowd solver and merge both together somewhere.

plug your crowd object into the 1st input of multisolver, other solvers in 2nd input and then use that output as 1st input of constraint network

Share this post


Link to post
Share on other sites

 

Hi, this was how the shelf tool sets up the nodes, just tried another one from scratch and it puts it in the same order. Here is the full network:

 

graph.thumb.jpg.1c7a5fc7b81cb5994a2aa9ea3aa399e0.jpg

Share this post


Link to post
Share on other sites

Cheers, but I still get the same warning when I add the constraints at the end of the network.

 

Capture.thumb.JPG.e594f2fcef5516a61ff98d9eb204c03b.JPG

Share this post


Link to post
Share on other sites

Hi. In Houdini 16 with regular ragdolls it works without any problems, but probably you already tried it in the past. 

Looking at your screenshot I see that the third input of the "ragdoll_constraints" is green. Shouldn't be violet in any case? I would say try look inside of it if the input is connected to the multisolver(violet) as usual or to the constraint network relationship (green).

Share this post


Link to post
Share on other sites

FIXED

For some reason if I delete the constraints network and make my own then it works.

cheers

Share this post


Link to post
Share on other sites

Sorry, now I have this part working I have another question:

I am using a primitivewrangle with the following VEX to delete the constraints, which now works.

    removeprim(0, @primnum, 1);

But what I need to do is only delete a specific joint. I'm not sure if you can search through the primitives by name in VEX or if I need to create a group for these joints somewhere else. 

My scene consists of a ragdoll with a Hat and I am trying to delete the constraint to the hat only. At the moment I am deleting all constraints.

Thanks for any help :)

Share this post


Link to post
Share on other sites

So you have to use the name of the constrained object. 

In the primitive wrangle you can check if the constraint has one of the two points with the name of the hat (for example using primvertex and vertex point functions). 

The problem is that probably you have all the names like this: agent01/hat, agent02/hat, agent03/hat... So you need to filter the name before the primitive wrangle with VEX in a point wrangle or an attribute string edit sop. With the point wrangle:

string splitname[] = split(@name, "/");      //create an array splitting the name at the "/"

s@splittedname = splitname[-1];    //take the final segment of the splitted name, so "hat"

 

In the following condition I would check if one of the two points has the s@splittedname=="hat". Or if you decide to promote it to primitive attribute you can use in the primitive wrangle:

if (f@torque > 50 && s@splittedname=="hat")
    @group_broken=1;
Edited by Andrea

Share this post


Link to post
Share on other sites

Thanks Andrea, that's really useful I will try and set this up later. I will let you know how I get on :)

Share this post


Link to post
Share on other sites

Hi,

This method would have worked but the constraint primitive names are all the same with a numbered footer per character. This only lets me break all joints on a single character. Not sure if this is going tobe possible unless I can find a way of changing the name of the primitives before DOPs.

cheers

G

Share this post


Link to post
Share on other sites

Got it working :D The names are correct on the point attributes I was only looking at the primitive attribute name. Thanks for the help!

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

×