QUOTE(andy_davis @ 08/10/09, 04:19 PM) [snapback]312926[/snapback]
I'm quite surprised that I can't find a thread that covers this topic,
Because the manual does, ableit a bit concealedly.
QUOTE
Tried the mentalRay vertex color node as described in the Maya documentation, but that doesn't seem to work.
Any ideas?
It works but it has some prerequisites you must meet before it does anything (this is explained in the manual but it contains assumtion thet youou know maya by the time you reach that point in the manual)
Ok ill guide you trough this. Ill paste some mel along the way so you can quickly follow suite if need to.
make a object and paint in some per vertex colors (mel to do a simple proxy):
CODE
file -f -new;
polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;
polyColorPerVertex -r 0.71428 -g 0.0314283 -b 0 pCube1.vtx[0:1] pCube1.vtx[6:7];
polyColorPerVertex -r 1 -g 1 -b 1 pCube1.vtx[2:5];
[li] Make a surface shader and connected in the mentalrayVertexColors node to it (again mel to get you jumpstarted)
CODE
shadingNode -asShader surfaceShader;
sets -renderable true -noSurfaceShader true -empty -name surfaceShader1SG;
connectAttr -f surfaceShader1.outColor surfaceShader1SG.surfaceShader;
mrCreateCustomNode -asTexture "" mentalrayVertexColors;
connectAttr -f mentalrayVertexColors1.outColor surfaceShader1.outColor;
[/li][li]Ok now we are close one would think assigning the surface shader to the object is enough. But alas thst not true. See each object can have any number of sets so first you nee to tell maya what sets your interested in.
So assign the surface shader to your object
CODE
sets -e -forceElement surfaceShader1SG pCube1;
[/li][li]Now go to the ae of mentalrayVertexColors1 and hit add new item this adds a cpv sets slot then in ouliner find the shape of your object (no not the trasform be sure shapes are enabled). Middledrag it onto the icon of mentalrayVertexColors1 in hypergraph. Then choose other in the issued menu. In the connection editor find colorset colorset[0] colorset[0].colorName and connect it to cpvSets cpvSets[0]. Or in mel (substantially shorter)
CODE
connectAttr -f pCubeShape1.colorSet[0].colorName mentalrayVertexColors1.cpvSets[0];
[/li]Done. Now for mixing this with textured noise run:
CODE
shadingNode -asTexture fractal;
shadingNode -asUtility place2dTexture;
connectAttr place2dTexture1.outUV fractal1.uv;
connectAttr place2dTexture1.outUvFilterSize fractal1.uvFilterSize;
shadingNode -asUtility multiplyDivide;
popupMenu -e -deleteAllItems graph1HyperShadeEdPopupMenu;
connectAttr -force mentalrayVertexColors1.outColor multiplyDivide1.input1;
connectAttr -force fractal1.outColor multiplyDivide1.input2;
connectAttr -f multiplyDivide1.output surfaceShader1.outColor;
Now the thing is you can use many cpv sets in one shader even from same node.