Advertisement
pushrbx

Maya 3D Surface Control Point Getter Py

Apr 27th, 2013
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. from maya.OpenMaya import *
  2.  
  3. def outputSurfacePoints(obj):
  4.     fn = MFnNurbsSurface(obj)
  5.     vts = MPointArray()
  6.     fn.getCVs(vts)
  7.     print "NumCVsU:"
  8.     print fn.numCVsInU()
  9.     print "NumCVsV:"
  10.     print fn.numCVsInV()
  11.     for i in range(0, vts.length()):
  12.         print str(vts[i].x) + " " + str(vts[i].y) + " " + str(vts[i].z)
  13.        
  14.  
  15. it = MItDag(MItDag.kDepthFirst, MFn.kNurbsSurface)
  16. while not it.isDone():
  17.     fn = MFnNurbsSurface(it.item())
  18.     if not fn.isIntermediateObject():
  19.         print "Object Name: " + fn.name()
  20.         outputSurfacePoints(it.item())
  21.     it.next()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement