Hi all
i need to translate each the vertices of a selected object to the position
in world space represented by their vertex color. So basically take RGB
color and make it XYZ position for all the verts.
I have this maya.cmds version that works fine, except it's massively slow
on any geo with more than about 5000 vertices:
#-------------
import maya.cmds as mc
selObjs = mc.ls(sl=true)
myVerts = mc.ls('%s.vtx[:]' % selObjs[0], fl=True)
for vert in myVerts:
col = mc.polyColorPerVertex(vert, query=True, rgb=True )
mc.move(col[0], col[1], col[2], vert, rpr=1, ws=1)
#---------
Now i'm trying to figure out how to do this with openMaya to speed things
up a bit, but having never used that Python API i'm having a bit of
trouble.
Seems i need to get the vert color list using *getVertexColors *then set
the positions using *setPoints*, somehow needing to translate the
MColorArray to an MPointArray...
Anyone have a simple way of doing this?
Cheers
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/383b873d-fd09-41db-a44b-5a8af1ecd71b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.