Would it be possible to share your solution? :) Best, Curious cat
On 19 January 2017 at 04:12, Paul Harris <[email protected]> wrote: > never mind, think i've figured it out.. > thanks anyway! > > On Thursday, 19 January 2017 09:25:07 UTC+13, Paul Harris wrote: >> >> >> >> 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/8461d7c6-c220-4fb4-b5f9- > f76f1509dba4%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/8461d7c6-c220-4fb4-b5f9-f76f1509dba4%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- 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/CAFRtmOC6Z%2BiuGrzqr-zJzS2F8LFyL1%3DXD7KCvuxF7mEaRdC90w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
