Select Mesh using color

Hi
Is there anyway to select the faces using the texture color value applied to it .
Example: A mesh having red color (in the texture… not vertex color)should be selected, where the mesh is properly tessellated.

The idea is to apply the basic texture with multiple color on the mesh. Then the mesh is selected using the color for changing the material property or the extracting the mesh … so on and on …

I was trying to modify the Displacement shader, which tessellates the mesh with the color value… but have no idea to continue for selecting using color value

Please help

Are you using maya?

If so, you could do something like this:
Iterate over your faces, get the vertices of that face.
Get the UVs of those vertices and average them (if your faces are triangulated, should get an accurate UV position).
Use maya’s colorAtPoint command to get the color of that UV position.
colorAtPoint takes a fileNode (eg a texture) and a UV coord, returning that color.

Then, based on your result, you can process your faces as you like.

Im using maya…
Thanks for the help… i will try it and post the result :slight_smile:

@dbsmith:
hey sorry for not updating…
The reply you gave was really helpful… and i am half done with the idea.
I used colorAtPoint command to get the color of all the UVs and then i use the colorgrab tool to pick a color and compare it with the UV color list i have and selet the mesh (form UV which matches the color )…
The idea is fine but its not accurate to my expectations, Im trying to make it fine… i will update with the script next time…

By trying this tool i learned how UV and color interpolation works :)…its cool :slight_smile:

im posting the same in Tools and Pipeline forum…