I'm trying to create a script that will select a bunch of Nurbs curves,
and measure the length of those curves.
So ideally I could select the shortest curve leaving longer curves unselected (or the opposite).
So far i have this:
import maya
import string
for i in maya.cmds.ls(selection=True):
shapeNodes = maya.cmds.listRelatives(i,shapes=True)
for shape in shapeNodes:
if maya.cmds.nodeType(shape) == "nurbsCurve":
print "Curve: %s is %s units long" % (shape, maya.cmds.arclen(shape,))
cvs = mc.getAttr(string.join(shapeNodes) + '.spans')+1
print "The: %s has %s cvs" % (shape,cvs)
else:
print "Wrong: %s is a %s" % (shape, maya.cmds.nodeType(shape))