openMP and MFnNurbsSurface


Hi folks,

Got another head scratcher for anyone interested:

Anyone here managed to multithread calls to MFnNurbsSurface safely? I’d like to do more point samping than I’m currently doing in Python for a new node idea, but I the heaviest calculation seems to be the sampling of the surface itself.

What are other people doing to get worldSpace points quickly? The dream here would be to use a #pragma omp parallel for on a loop that grabs all the points together, and then the same on the loop that does the calculations.

Near as I can tell you can’t use MFnNurbsSurface on anything without first having a DAG object, so would it be better to somehow copy all that information locally and calculate the surface myself? (Not that I’d know how to pull that off. :wink: )

Thanks as always,
~ K


Since probably this object won’t support multi-threading, and it would be too slow anyway, I think the best thing for you to do would be to get all the nurbs parameters from maya, and calculate the nurbs yourself. If you are reluctant to implement nurbs by yourself you can look for a nurbs package for python, such as this first google result:


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.