CVs’ on a NURBS curve
Uncategorized July 1st, 2009I know you are just thrilled by the title of this post right? Well if you aren’t then you are probably not a technical artist, because for a geek like me this is hot stuff. I have been doing a lot of Python scripting in Maya the past few months and I think it is time I start sharing some of the neat things I come across. So here I go with what I hope to be a series of cool commands to make your life with Maya more enjoyable.
As of Late I found myself needing to make a list of all the Cvs’ on a nurbs curve. This can be a handy trick if you are trying to record the shape of a curve, or if you simply need to perform some function at a component level. In this example I wanted to make a list of the cvs’ so I could create a cluster on each one. You need to select a curve before running the script.
import maya.cmds as cmds
import maya.mel as mel
mopathCurve=cmds.ls(sl=True)
print mopathCurve
for pathCurve in mopathCurve:
cmds.select (pathCurve+’.cv[*]‘)
pathCvs=cmds.ls(sl=True, fl=True)
for cv in pathCvs:
print cv
cmds.cluster(cv)


July 22nd, 2009 at 7:11 am
Thanks Ryan. I’ve restarted some Python work in Maya to export NURBS to another app and I was stopped trying to remember how this was supposed to be done. You saved me a few ours of trial and error.