Vertex Color Information

Hi, I have colored in my vertices of my model with the Paint Vertex Color Tool and I was wondering if there is any way to retrieve the color information of a vertex. I looked at the attributes of the vertex but there seems to be no color attribute. I'd like the color information so I can edit it with some MEL later.
Thanks for any help!

the same command used to set the vertex colours can also be used to query them:

polyColorPerVertex -query -rgb;

check out the doc for this command. Also, there are colour attributes on the mesh nodes (have a look at the mesh node doc) but weirdly they always seem to be set as 0 no matter what the colour..?

:nathaN

polyColorPerVertex -query -rgb; returns 0 0 0 if there is no color set yet.
As soon as you asign a color to a vertex it will return this color.

I mean I'm not really into vertexcolors that much but I just made myself a custom vertexColorTool to get and set vColors. Its simple but helped me a lot better than every other native maya tool yet. Whould like someone? ;]

But Naughty? How can one retrieve that mesh node color attributes? I tried to rtfm but i didn't dig it.
And do you know a way to query IF there is a color already set to a vertex or not? I mean there must be a difference somewhere..

I have the feeling that they let the vertex color stuff rot the last releases.. For instance if you vertex color and then try to undo!! -> aaahhgrrgrgrr!!! And I felt the built in Apply Poly Color tool crahed my Maya constantly .. fortunately my tool seems not to do this :]

you can get/set the attrs like so:

getAttr pCube1.colorPerVertex.vertexColor[0].vertexColorRGB;

where the [0] is the vertex index in question. If you look at the mesh node doc it shows this attr heirarchy and also mentions for the vertexColor part of the attr: The attribute is a multi with the index of the multi identifying the vertex that the color applies to so you know it should be entered with the index syntax [n]

but, as I said, it always returns 0 even if you have a colour there...? very odd... although there is another, separate vertex face attr which may yield more results but to be honest I just can't be bothered to investigate it further...

see also these old posts ewerybody:

http://www.highend3d.com/boards/index.php?showtopic=195237
http://www.highend3d.com/boards/index.php?showtopic=213248

and you're right, vertex colouring does seem to be a stagnant cess-pool..

:nathaN

hehe
didn't someone tell me they just did some vcolor stuff in the latest release.? bollocks.

jep the posts are interesting but disappointing after all :confused:

QUOTE(naughty)
I just can't be bothered to investigate it further...
hey no problem man! Already told me a lot :] Thanks!!

Hey! Thanks for the help guys! I got it working now. I was making a tool to adjust all the vertex colours in a mesh for bright/contrast hue/sat. I'm getting there!

Oh, since I am here, does anyone know if there is a scriptJob event for when the user changed the color set? I tried all the ones I thought would be it but none work! Its driving me crazy so I sort of gave up and made a button to update color values instead! I'd like to make it a bit more user friendly though...

Cheers!