Well, what i actually want to write is a PyTex that just gets the Vertex colours. That way we could use grayscale vertex colours as a stencil map for example. That way we could paint stencil maps directly onto the mesh!
JMS, I worked though your code, but you don’t actually find out the face-number, but only use a very tricky method to find the edges. Am i right?
Anyway, to extract the vertexcolor i need to know the ID of the face that is being rendered, and the coordinates, so that i can get the vertex colour and interpolate them.
The coordinates could be get by setting the mapping of the texture to “global” and calculating these coords into local object space.
Or the mapping option “orco” could be used, but only if texture coordiates = local space coordinates.
But then i still have to find out the number of the face (vertex colours are stored in the face, AFAIK)
I think raytracing is the only option at the moment, though it would be great to have a Pxtex function to get the face-number.
Raytracing would take rather long i guess.
If anyone knows a better method, or has any idea please tell me.
Or if anyone is willing to develop the script, go ahead!
I think this would be a very nice feature to have in Blender. At the moment it sounds like doing quite a lot of workarounds in python.