how to set the vertex color in the center of the mesh to black and the rest of the vertices to red via python? a lot of the answers just tell me that i can color all the vertices in one face like that:
for poly in mesh.polygons:
for loop in poly.loop_indices:
color_layer.data[loop].color = (0,0,0)
but how can I get the specified vertex in the center and set it's color? Thank you very much
supplement(my script is as follows):
import bpy
import bmesh
#create a hexagon
bpy.context.scene.cursor_location = 0.0, 0.0, 0.0
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()
bpy.ops.mesh.primitive_circle_add(vertices=6,fill_type='NGON')
ob=bpy.context.active_object
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.inset(thickness=0,depth=0)
bpy.ops.mesh.edge_collapse()
#I can select the center vertex in edit mode
bm = bmesh.from_edit_mesh(ob.data)
verts_center=[v for v in bm.verts if len(v.link_edges)==6]
vertexColors=ob.data.vertex_colors.new().data
#when it comes to object mode or vertex paint mode, how do I change the color of the vertex I selected?
as I know, in this example, the vertex I select will have six vertex color data, how do I get those six data and set the color?