Hi,
I'm trying to work on a python script that can iterate through the all the control vertices of a selected nurbs surface & return the position of the 1st cv and then moe onto all the cv's in the selected nurbs surface and get their respective point positions in space.
I went through the maya documentation and found out that we need to use the MItSurfaceCV class and its functions to access a nurbs object at the cv level.
CODE
import maya.OpenMaya as OpenMaya
import maya.cmds as cmds
def selectedObject(currentObject):
objectSurface = OpenMaya.MItSurfaceCV()
objectSurface.MItSurfaceCV(currentObject)
objectSurface.reset()
cvPosition=objectSurface.position()
return cvPosition
print "Find the selected nurbs object";
selObject= cmds.ls(sl=True);
seObj=[selObject];
print seObj[0];
objectResult= [selectedObject(seObj[0])];
I'm a bit new to Python but I would really like to know how I can access such API classes for use in python scripts.
Thanks in advance,
Nikhil.