What is really annoying is that I currently have to call a Blender function through Python for each hair strand.
For example, the conversion of a hair system with 200,000 individual hairs has these timings:
- Calling Blender's
co_hair function 200,000 times to fill a numpy array with coordinates: 5.342 s
- Checking the points for invalid ones, calculating the number of valid segments etc. (this code was pure Python before and is now C++): 0.083 s
- Tessellating the hair with "triangle ribbon" mode: 1.05 s
I will have to check again if I can somehow do the first step in C++ as well, but last time I looked it wasn't feasible.
(by the way the same hair system takes 20.951 s to export with the old code)