eko Posted December 27, 2015 Share Posted December 27, 2015 Hi, allI am trying to delete points in HDK using the Code: gdp->destroyPointOffsets(GA_Range(*delgroup)); There are about 30000000 points in delgroup. It works fine but it seems "gdp->destroyPointOffsets" method is very slow.I found if I use the "Blast" Sopnode in houdini and select the delgroup. It works much faster(about 50 times) than "destroyPointOffsets" function in hdk.I wonder that is there any ways to makes delete points faster in HDK.Thanks! Quote Link to comment Share on other sites More sharing options...
edward Posted December 27, 2015 Share Posted December 27, 2015 How many points total? The Blast SOP needs to make a copy of the geometry anyhow, so in certain cases, it will *copy* the points you want to keep instead (via mergePoints()). It might also be faster if you convert the point group to a primitive group first and then delete by primitives. However, it depends on the actual geometry that you have. Quote Link to comment Share on other sites More sharing options...
eko Posted December 28, 2015 Author Share Posted December 28, 2015 Hi,thanks for reply! There are about 70,000,000 points total! There are all points and no primitive. I take your advises and use gdp->appendPointBlock() for adding points and used multi thread For setting Postion of these points. But There are some points that I don't want. I try these: gdp->destroyUnusedPoints(pointgroup); gdp->deletePoints(*pointgroup); gdp->destroyPointOffsets(GA_Range(*pointgroup)); But they are not fast as the Blast Sop. Quote Link to comment Share on other sites More sharing options...
edward Posted December 28, 2015 Share Posted December 28, 2015 No, I mean to try copying the points you want to keep instead of deleting the points. const GU_Detail &input_geo = *inputGeo(/*input_index*/0, context); pointgroup->toggleEntries(); // pointgroup is now the points to keep gdp->stashAll(); gdp->mergePoints(input_geo, pointgroup, /*keepgrps*/true, /*internal*/false); gdp->destroyStashed(); Or if you don't have an input gdp to copy from, then perhaps something like this (but likely slow): pointgroup->toggleEntries(); // pointgroup is now the points to keep GU_Detail geo; geo.mergePoints(*gdp, pointgroup, /*keepgrps*/ true, /*internal*/ false); gdp->duplicate(geo, /*unused*/0, GA_DATA_ID_CLONE); Quote Link to comment Share on other sites More sharing options...
eko Posted December 30, 2015 Author Share Posted December 30, 2015 Hi, Edward. It's almost the same number between keep and deleting the points. Thanks for your help. I got it. It' works very well. I use pointgroup->toggleEntries(); // pointgroup is now the points to keep GU_Detail geo; geo.mergePoints(*gdp, pointgroup, /*keepgrps*/ true, /*internal*/ false); gdp->duplicate(geo, /*unused*/0, GA_DATA_ID_CLONE); 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.