Jump to content

Crowd - particle interaction


kev2

Recommended Posts

Loving the the new crowd tools in 15 but can't get particles by proximity to work as a transition trigger. Anyone else try them out? I've tried a variety of set-ups but no luck. RBD impacts, time, object bounds all work as expected. Great additions. 

 

I've tried adding / adjusting pscale, the trigger attribute (setting it to true (1)), etc but no luck. Tips and tricks appreciated,

 

Thanks, Kevin

Link to comment
Share on other sites

I found that Proximity did work, at least in H14. Can you post some kind of simple setup where it fails?

 

Make sure your overall scale is not too far from the default biped scale or you may have to use extremely large or small numbers throughout the AutoDop network.

Edited by Atom
Link to comment
Share on other sites

Ok, I think I see why it is not working. In crowd terms particles are agents. But you have also introduces a particle system into the mix. The Particle Proximity only works with the agent particles, not the additional particles. Your intention of setting the i@crowdtrigger_bullet flag in the pop wrangle is correct, but because of the context, you are actually creating a new i@crowdtrigger_bullet attribute on the new particle system instead of setting the value for the crowd system. Use the Geometry spreadsheet to verify that attributes are really being set where you want.

You may just want to make each particle a RDB object then use RDB triggering. There is a nice video on SideFX vimeo that shows how to set this up.

 

 

If you take your existing crowd trigger Proximity node and put it into VEXpression mode and paste in this code you will have access to the particle points and can dial in the distance via the IF statement. Now when an agent walks into the particle stream it will transition to a rag doll.

string handle_path = "op:/obj/crowd_sim:popobject1/Geometry";                   // Get the handle to the other particle system.
int psys_count = npoints(handle_path);                                          // Get the particle count.
for (int i = 0; i < psys_count; i++) {                                          // Begin looping through all particle.
        vector candidate_location = point(handle_path,"P",i);                   // Get the particle position.
        float candidate_distance = length(candidate_location - @P);             // Distance between particle and agent.
        if (candidate_distance < 1) {
            i@trigger = 1;
            break;
        } else {
            i@trigger = 0;
        }
}
Edited by Atom
Link to comment
Share on other sites

Thanks Atom, I see what you did there but didn't get it to work but I think that's because Houdini has a bug (see the attached image) where it renumbers points with the same number so I end up with agents and particles that have the same particle number. I think it has something to do with the new version of MacOSX. I submitted it as a bug a few days ago so I imagine SideFX will sort it out soon. In the meantime, I get all kinds of strange results. 

 

For now,  what I do get is particles bouncing off the agents (which was unexpected too).  I attached my script with your VEX included in a wrangle. I'd love to know if it works correctly for you.

 

Thanks,

Kevin 

testCrowds.hiplc.zip

post-6468-0-32882800-1445638662_thumb.pn

Link to comment
Share on other sites

Don't place the code in a popwrangle after the transition, change the orange CrowdTrigger into VEXpression mode and paste the code into that node before the transition. If you place the code after the transition no triggering will occur, It all flows downstream, in this case. i@trigger is what activates CrowdTransition nodes. It must be set before the node is evaluated.

post-12295-0-90427800-1445692978_thumb.j

Edited by Atom
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...