I want to do something like this with a python script and selecting the vertex in the middle:
I tried with many ideas as:
import bpy, bmesh
obj = bpy.context.object
me = obj.data
bm = bmesh.from_edit_mesh(me)
verts = [v for v in bm.verts if (v.select==True and not v.hide)]
for v in verts:
for f in v.link_faces:
if (f.index%2) != 0 :
f.select = True
obj.active_material_index = 3
bpy.ops.object.material_slot_assign()
f.select = False
else:
f.select = True
obj.active_material_index = 4
bpy.ops.object.material_slot_assign()
f.select = False
bmesh.update_edit_mesh(me, True)
but this don't have good results.
I'm tried with face.index, bool and other without good result.