Blender 2.66 python


I want to be able to create a UV image from within python. I want to be able to control the color values of each face of an object, and be able to save each face color value as a uv image texture.

One possibility I’ve found is to use vertex colors. By editing the vertex color value using:[0].data[0].color = Color((0,0,0))

Then baking the vertex colors to the UV image. However, how do I go from the index number of a vertex to the specific vertex color data “vertex_colors[0].data[X]”

Is there another way to edit UV images from within python? Is there a way to edit the values of a UV image texture from blender? Can python access the UV coordinates of faces in the UV image?

Much appreciated!

Im not sure what you want todo.
I guess you want to save the vertex_color_map as an image using UV_Map coordinates.
Heres some python data.

# vertex_colors
Color((1.0, 0.9019607901573181, 0.0))

# uv_layers
Vector((0.6687497496604919, 0.5000002384185791))

# images
me ='Cube')
if me is not None:
    for li in[li].color = (1,0,0)