Thanks! On 19 January 2017 at 21:36, Paul Harris <[email protected]> wrote:
> i mean here: > https://gist.github.com/anonymous/2dc8ad6d23219337f6fc20321523e499 > > > On Friday, 20 January 2017 09:35:33 UTC+13, Paul Harris wrote: >> >> sure, here it is: >> >> <script src="https://gist.github.com/anonymous/2dc8ad6d23219337f6fc2 >> 0321523e499.js"></script> >> >> On Thursday, 19 January 2017 21:51:06 UTC+13, Marcus Ottosson wrote: >>> >>> 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/ms >>>> gid/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/12d908f2-4dc0-4645-abb3- > ba5e8bed5ace%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/12d908f2-4dc0-4645-abb3-ba5e8bed5ace%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/CAFRtmOAJEnwnnw0x1cnbUMSWTKUxGQFudqcROa3tsf2F0VX-Kg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
