import maya.cmds as cmds<br><br>sel = cmds.ls(sl=1, fl=1)<br>spansNumber = cmds.getAttr((cmds.listRelatives(sel, p=1))[0]+".spans")<br>curveDegree = cmds.getAttr((cmds.listRelatives(sel, p=1))[0]+".degree")<br>cvGlobalName = (sel[0].split("[")[0]).split("]")[0]<br>for x in sel:<br> nextCvNumber = int((x.split("[")[1]).split("]")[0])+1<br> prevCvNumber = int((x.split("[")[1]).split("]")[0])-1<br> if nextCvNumber <= ((spansNumber + curveDegree) -1) :<br> nextCv = cvGlobalName+"["+str(nextCvNumber)+"]"<br> cmds.select(nextCv, add=1)<br> if prevCvNumber >= 0 :<br> prevCv = cvGlobalName+"["+str(prevCvNumber)+"]"<br> cmds.select(prevCv, add=1)<br>
Replies