maxpayne
Hi johnmather. Thank you for the link. I've actually seen this but I can't figure out how to build 'Range' out of point groups or it can be Array or a list of Ranges ?
Thank you
you don't have to build a splitted range for the function john sir showed to you, as much as i know, it is meant to run on each pages parallely, pages as i know are the way houdini stores the attribute data, they are contiguos blocks of data and have a fixed size (1024 elements, you can see it in ga_types header), and the page handle gives you direct access to the data from memory (read the attributes 101 in docs), and it will be the fastest way to read/write attribute.
here is the test code i tried-
GU_Detail* gdp = parms.gdh().gdpNC();
GA_Range pointRange = gdp->getPointRange();
GAparallelForEachPage(pointRange, true, [&](GA_PageIterator it){
std::cerr << "page off-" << it.getFirstOffsetInPage() << std::endl;
});
and it gives this result on console with 10000 points-
page off-0
page off-1024
page off-2048
page off-3072
page off-4096
page off-5120
page off-page off-61447168(some lines overlap because it is parallel)