I will leave it to Conrad to answer the C-API part of the question.
As for the PRT file approach, the Krakatoa MX FranticParticles interface contains a method that creates a PRT file from Max Hair, and Krakatoa SR supports that layout as a valid curve file. The channel layout of the Hair PRT file is the following:
Position float32[3] SplineIndex uint32[1] KnotIndex uint32[1] Velocity float16[3]
SplineIndex is the 0-based index of the curve the point belongs to.
KnotIndex is the 0-based index of the point within the curve.
Velocity describes the motion of the point in units per second and allows for correct motion blur.
For each curve, the knots get sorted by Index and then the curve gets resampled to new points according to the “curves” “WorldSpacing” option, with the “DensityFalloff” giving the falloff exponent for the Density from root to tip.
This is a bit Max-centric and was implemented as a temporary solution to rendering hair curves in the early Beta days. But being a PRT file, it is both easy to write out and manipulate with Magma in Krakatoa MX, so it will probably be supported in the future. We are open to discussion of alternative formats/layouts that would be more universal…
I have enough information to experiment with writing out some hair files via the PRT-IO-Library.
What kind of splines are the knot vector being interpreted as ? I need to know what is the minimum number of points required per strand and if there is an basis information I need to keep in mind.
Hi Nicholas, the Krakatoa Python library has spline reading code, however this is not been exposed in the C++ API yet. Adding this to the API is on my list of things to do, and it will be done.