kev2 Posted October 19, 2015 Share Posted October 19, 2015 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 Quote Link to comment Share on other sites More sharing options...
Atom Posted October 21, 2015 Share Posted October 21, 2015 (edited) 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 October 21, 2015 by Atom Quote Link to comment Share on other sites More sharing options...
kev2 Posted October 21, 2015 Author Share Posted October 21, 2015 Hi Atom, Attached a test scene. By overall scale, do you mean the area size of the agent distribution? In this scene the distribution area is fairly small for 50 agents, 20 x 16. Thanks for taking a look, Kevin testCrowds.hiplc.zip Quote Link to comment Share on other sites More sharing options...
Atom Posted October 23, 2015 Share Posted October 23, 2015 (edited) 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 October 23, 2015 by Atom Quote Link to comment Share on other sites More sharing options...
kev2 Posted October 23, 2015 Author Share Posted October 23, 2015 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 Quote Link to comment Share on other sites More sharing options...
kev2 Posted October 23, 2015 Author Share Posted October 23, 2015 &- Switching to RBD s would work too. RBD triggers inspired me to make this Halloween masterpiece: -k Quote Link to comment Share on other sites More sharing options...
Atom Posted October 24, 2015 Share Posted October 24, 2015 (edited) 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. Edited October 24, 2015 by Atom 1 Quote Link to comment Share on other sites More sharing options...
kev2 Posted October 24, 2015 Author Share Posted October 24, 2015 Completely missed the VEX Expression trigger. Works like a charm now. Thanks a lot Atom, I learned a lot from this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.