best way to loft a nurbs surface from a curve via script



I am currently writing an autorigger for a variant of a ribbon rig in maya. since day one I have the problem that I never get a nice nurbs surface.
imagine the curve to be a straight line from (0,0,0) to (10,0,0). to loft a surface from that I’d usally duplicate the curve and move it +1 on the z-axis. that way I get two parallel curves. this works in a couple of cases but for example not if the curve is parallel to the z-axis my nurbs surface ends up beeing infinitly narrow. if I’d do this by hand of course I would just move the duplicated curve another way but since this is scripted I have to figure out a different way. additionally this does of course not work well for acutally curvy curves because they do not end up beeing the same width all the time.

any help and ideas are appreciated


You can sample joints or other transform nodes along that curve, orient them along it using the previous object as rotationUp object (to prevent world up vector flipping on s-type curves), parent a second set of nodes on top of them, and move those in local up axis. from there generate a new curve along those new points, rebuild it with the rt flag on 2 so it matches the knots from the first curve, and do your loft from those. Then maybe delete nodes you dont need anymore from that second curve generation.
I use this method to create upVector curves for spline rig scripts.


thanks for answering. I figured out that I could use joints and their local axis too just like you said but using the previous object as a up object was exactly what was not working yet.

big thanks :thumbsup:


finally finished my autorigger so far if you want to have a look:


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.