buran13 Posted June 7, 2011 Share Posted June 7, 2011 Hey guys, I'm trying to clean up particle sims coming from RealFlow. Is there a way to delete a group of particles based on their ID attribute and not the point number? The amount of particles I need to get rid of is quite big, so it'll be really helpful if there is a way I can just select them in the viewport. Any help is most appreciated! Thanks Quote Link to comment Share on other sites More sharing options...
static Posted June 7, 2011 Share Posted June 7, 2011 Made a quick and dirty example, notes are in the file. Hopefully it helps. kill_by_id.hip 1 Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted June 7, 2011 Share Posted June 7, 2011 The plugin should be able to import the ID if you are using a current plugin. The first few versions used $PT as the ID but that was later changed to use the RealFlow ID instead. In a delete SOP they can be deleted with the same expressions as any other particle (like $ID % 10). Quote Link to comment Share on other sites More sharing options...
lukeiamyourfather Posted June 7, 2011 Share Posted June 7, 2011 I didn't understand what you meant at first. This might help too but it runs on the RealFlow side. http://www.realflowforum.com/view_topic.php?id=2821 What Blair posted for Houdini is probably the easier way to go. Quote Link to comment Share on other sites More sharing options...
buran13 Posted June 7, 2011 Author Share Posted June 7, 2011 Made a quick and dirty example, notes are in the file. Hopefully it helps. kill_by_id.hip Static, thank you so much!! Exactly what I need. Although it takes a bit of time to cook with the amount of particles that I have. Is there maybe a way to store the "kill" information in a temp file or something and use that instead of doing a loop for each particle? Sorry if I'm asking dumb questions. I'm a noob with Houdini. Lukeiamyourfather, thanks for the help, but I prefer to do it in Houdini. This can be very very useful not just with RealFlow particles but with particles coming from Houdini or Maya. Thanks again Quote Link to comment Share on other sites More sharing options...
static Posted June 7, 2011 Share Posted June 7, 2011 Is there maybe a way to store the "kill" information in a temp file or something and use that instead of doing a loop for each particle? Sorry for the delayed reply... my caches came back at work I made a quick python function that does that, so it only iterates once (when it's constructing the delete expression). Now it should run faster, and only requires a delete sop with a couple spare parameters. The script itself is stored in the hou.session module, accessed by going to the top menu Windows -> Python Source Editor Keep in mind that you still need to replace the blast node with whichever one gets created, or you could chain them together, where each delete SOP references a different blast SOP. I'm tempted to clean this up and post an otl on the exchange when I have some time. It seems pretty useful. kill_by_id_exp.hip Quote Link to comment Share on other sites More sharing options...
buran13 Posted June 7, 2011 Author Share Posted June 7, 2011 Sorry for the delayed reply... my caches came back at work I made a quick python function that does that, so it only iterates once (when it's constructing the delete expression). Now it should run faster, and only requires a delete sop with a couple spare parameters. The script itself is stored in the hou.session module, accessed by going to the top menu Windows -> Python Source Editor Keep in mind that you still need to replace the blast node with whichever one gets created, or you could chain them together, where each delete SOP references a different blast SOP. I'm tempted to clean this up and post an otl on the exchange when I have some time. It seems pretty useful. kill_by_id_exp.hip This way is actually waay slower for me. I'm not sure, but I think it's fast to store the $IDs that need to be deleted, but it takes forever for Houdini to actually delete the points. Each point has do go through this huge Filter Expression that contains all the point IDs conditions. Deleting just a 100 points or so makes it extremely extremely slow. Maybe I'm doing something wrong I'm not sure. Thanks a lot for helping me out with this! Quote Link to comment Share on other sites More sharing options...
static Posted June 7, 2011 Share Posted June 7, 2011 what's your point count? Deleting points can take a long time depending on the amount you're working with. If you're deleting thousands, then the expression will take some time to construct as well. Keep in mind that deleting geometry can be slow because houdini has to delete it for each cook (frame). Quote Link to comment Share on other sites More sharing options...
static Posted June 7, 2011 Share Posted June 7, 2011 I see what's happening. I'm not sure if there's a way to access points with specific attrib values in python (ie: specific ids) without looping through all points. At that point it may be better to look at the hdk, which I'm unfamiliar with Using a python SOP, I think you would still need to loop through all points -> check for id -> delete. I'm not sure what the speed gains would be. Quote Link to comment Share on other sites More sharing options...
buran13 Posted June 8, 2011 Author Share Posted June 8, 2011 I see what's happening. I'm not sure if there's a way to access points with specific attrib values in python (ie: specific ids) without looping through all points. At that point it may be better to look at the hdk, which I'm unfamiliar with Using a python SOP, I think you would still need to loop through all points -> check for id -> delete. I'm not sure what the speed gains would be. I ended up using the original setup. Takes a while to cook but very reasonable for the amount of particles I have! (about half a million) Again, thanks a lot for your help! 1 Quote Link to comment Share on other sites More sharing options...
Ryan Posted July 20, 2011 Share Posted July 20, 2011 I just uploaded an asset to the Houdini Exchange that does this. With it, you can either select the points in the viewport and then run it as a tool, or simply lay it down and input the list of ID numbers. You must be in SOPs. Its much faster that creating a long expression, because it stores the IDs in a hidden geometry. Hope it helps. sop_kill_particle_ids.otl Quote Link to comment Share on other sites More sharing options...
fxrod Posted September 20, 2012 Share Posted September 20, 2012 I just uploaded an asset to the Houdini Exchange that does this. With it, you can either select the points in the viewport and then run it as a tool, or simply lay it down and input the list of ID numbers. You must be in SOPs. Its much faster that creating a long expression, because it stores the IDs in a hidden geometry. Hope it helps. Just wanted to thank Ryan! Pretty fast tool. 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.