Sunday, 14 May 2017

How to Create Custom Constraints for Your Ragdolls in VEX

In this tutorial I’m talking about how to create custom constraints in VEX for your ragdoll sim. Unfortunately I got over my 10 minutes limit, but there was just so much stuff that I needed to squeeze in.

It’s a bit technical so you probably need to have some basic understanding of VEX and ragdolls to be able to appreciate it.

If you don’t want to write the code yourself you can copy it from here:

int number_of_agents=npoints(1)-1;

string left_hand;
string right_hand;

int pointID_left;
int pointID_right;

for(int i=0; i<number_of_agents;i++){

    pointID_left=findattribval(0,"point", "name", left_hand,0);
    pointID_right=findattribval(0,"point", "name", right_hand,0);  
    int primID=addprim(0,"polyline", pointID_left, pointID_right);
    setprimattrib(0,"constraint_name", primID, "Pin","set");



  1. Nice tute. I just finished a simple tvc using houdinis crowd. First real project I've done with Houdini. Something that stumped me was getting agents to blend from ragdoll back to another state with mocap in it. Best I could get was a hard pop. Any ideas on how to overcome that one?

    1. Thanks! I haven't actually tried that so I would need to do some experimenting, but you probably would need to read the agent transforms in the intrinsics and do the interpolation in a sop solver yourself to avoid popping.

    2. haven't been using houdini that long so until you mentioned intrinsics then I had no idea you could even get those transforms out of the packed prim for the crowd :)
      Really like your crowd tutes as I'm learning a lot from them. I've high hopes of really diving into the crowd system and being able to customize it a lot. Your tutes give me a great idea of what sort of things are possible and how to approach them.
      PS. my previous reply seems to have tagged me as unknown but looks like on my workstation its realised my google profile, so above Q was from me.

    3. I'm happy to hear that!:) I think what makes Houdini my favorite tool for crowds is that nothing is hidden and you can just do it yourself if it's not there already. Being able to go in and set the transform matrices yourself have saved me more than once.

  2. This comment has been removed by the author.