Scripting an EP Curve with Python

Hi,

does anyone know how to create an ep curve with python?
Using the “curve” command creates a cv curve. But I need my curve to run through the center of every joint, as I want to use it for a dynamic bone chain later.
I tried to use the “fitBspline” command after creating my cv curve which seemed to work fine, it rebuilds my cv curve with a point in the center of every joint. But when I then use the maya “makeCurveDynamic” command, the output Curve doenst match the input curve. It looks quite similiar, but the points are not longer in the center of the joints.

I think the trick with the curve command, is you pass your points in as editPoints instead of points.
At least this seems to work for me.



import maya.cmds as mc

points = [[0.0, 0.0, 0.0],
          [1.0, 0.0, 0.0],
          [2.0, 0.0, 0.0],
          [3.0, 0.0, 0.0]]
mc.curve(ep=points, d=3)


1 Like