Sorry if this is known thing but I couldn't find anything so far.
So I'm writing out hair data from a groom. I want the @P 3 vec and the @width data. I was using a python script to write it out with numpy arrays to do the writing of the float data to a binary file. I am preallocating the array and writing into indices but the for loops themselves I'm using to access the data in houdini are very slow for larger grooms. At first I was using a nested for loop like:
for curve in curves.prims():
for point in curve.points():
then switched to a single loop over all points like:
for point in curves.points():
and kept track of the indices myself but it's still pretty slow.
Is there a faster way to do this? I've tried regular python lists and looked at the csv exporter in the game dev shelf. That's all still slow.
Fastest way to write data out of node?398 2 1
I assume you need the individual curves to be known… otherwise you can grab an entire attribute efficiently using functions like this one:
- Quick Links