hai friends
i have created a poly plane and applied a phong material to it, then applying a ramp to that phong material
now i want to select vertex in that plane, depending up on the color,
for eg, select what ever the vertex lies under redcolor,
is there any way to do that
thankyou
Well yes but you should reechek yoru workflow. Anlso is this red beofre or after shading. Red as per channel red or color red?
Sure: Using a command like this:
colorAtPoint -o RGB -u .5 -v .5 ramp1;
You could walk though each of your verts, figure out their UV position, query their color. If your color == red, then add them to a selection list.
thanks for the kind replies, joojaa and warpcat
for joojaa,
red after shading and red as per color
its not depending on vertex color, its depending on the shader color
for warpcat,
suggestions to query the UVs through vertex position
thankyou
[codebox]// pick your vert and define it:
string $sel[] = ls -fl -sl;
// convert it to it's UV:
string $UV[] = polyListComponentConversion -tuv $sel[0];
// query the UV's value:
float $uvval[] = polyEditUV -q -uValue $UV[0];
// then query the color on "ramp1" at that UV position:
float $color[] = colorAtPoint -o RGB -u $uvval[0] -v $uvval[1] ramp1;[/codebox]
umm could you not ask general quetsions, intead say what you need it for.
Before or after lights affect the shader? Maya does not actually know the value of lightning until it does a render (kindof the point of doing render at all), you can off course go ahead and bake and ask it after that. or do a very specific one pixel render, or shoot reays in render context (but not with mel sorry)... Secondly even uvs don't help unless you are in special circumstance what you can guarantee the uvs dont overlap.
Anyway red is a bit undefined by computers, in general sense you could think rgb colors redness is r-b-g then youd geta float and you could say everything above 0.5 is sufficiently red. However you could also think of red from prespective of the hue of a hsv colorwheel, however again a bit problem to discern it form white.
QUOTE
suggestions to query the UVs through vertex position
well thts not hard, convert the selection to uvs and ask for the position of it in uv space. but problem is you could get many answers from one polygon.
Thanks for the kind information warpcat and joojaa
warpcat thanks for the commands, its working fine
joojaa thanks for the extra informations too
Thankyou