UV vertex distribute?

Could anyone please code a simple vertex distribute function for Blender’s UV/image editor window? Say you selected a line of vertices in the UV window and you want them spaced evenly, either horizontally or vertically, with the start and end points unmoved but all selected vertices between them moved so that they are evenly spaced from one another.
Arranging the mesh into a uniform grid in the UV window is a pain. Specially since there is no grid to snap to and the alt button for selecting edge loops doesn’t work. The W button works great though. Just wish there was an added option for distribute X or distribute Y in it… :-?


for x in range(len(me.faces)):
			
me.faces[x].uv = [(1,0),(1,1),(0,1),(0,0)]
				
me.update()

This should go through a list of all faces in a mesh is the mesh is selected as “me” and set the uv coords for each face as the values input.

To get the uv coords just use the me.faces.uv thing as well.

… nice if your mesh is quads only. is there an easy formula that would work similar to simple cylindric unwrap - on a strip of faces? f.e. for selected faces or faces that are members of a vertexgroup?

In the current API, how can we know if a vertex in the UV/editing window is selected or not ? Interesting problem … I make a few tests and I come back .

Ok, not in the API doc but we can :
http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_python_uvmap_en.htm#vertexselectionnedansluveditorwindow

Yeah that would sure be a time saver.

Something similar does my UVMap script. It is two years old but usable. I should update it to jms’s method for UV vertex selection.