Thats what i want to achieve. You sequentially select any even number of vertices, and after running command all pairs of vertices, i.e. vertices 1 and 2, 3 and 4, and so on, are connecting with an edge.
Pairs are defined by sequence of selection. I.e. 2 vertices which was selected first = first pair, 2 additionally selected vertices would become a second pair, and so on.
Maybe some know any addon with this functionality?
Image above is just a simple way to explain desired behavior. Its not a real case.
Real cases can be complitely different, so its not about grid fill and any vanilla tools.
Not sure why you would want an add-on for this, but maybe I’m misunderstanding the question. I think Okidoki gave you a good answer, or you can just select the two verts you want joined and press ‘J’.
I guess you could call bpy.ops.mesh.vert_connect_path() for each pair of vertices -but this is an operator that works on selection, so you would have to store your full selection first (into a list or a dictionary) and then iterate through that, make sure you deselect all then select the pair, and run the operator. You can access selection order through this : https://docs.blender.org/api/current/bmesh.types.html#bmesh.types.BMesh.select_history
Check 2nd picture.
First of all in case of last vertices pairs (5 and 6) triangulation will not help at all, it will create second edge which shoudnt be there.
And whole point is to make creation of edges fast. Currently its:
select first vert
press shift
select second vert
press J or whatewer
Move on to next pait.
Its slow and unnecessary pressing buttons.
In solution which i want to find you press shift only once, when select vertices and press “J” only once.
Wait lol, there is “connect vertex pairs” that does exactly what you need. Just type F3 then the operator name and you should be good. It doesn’t go across faces though, is it a dealbreaker ?
EDIT:
I checked.
Oh man, it’s even in the article I linked. “The main difference between this tool and Connect Vertex Path is that this tool ignores the selection order and connects all selected vertices that share a face.”
I see. So you want an add-on which will automatically fill all gaps? Then yes, “j” method is slow. How would one end up with a mesh like this in the first place?
Most cases you can either use grid fill (Ctrl-F>Grid Fill), bridge edge loops (Right-Click>Bridge Edge Loops), or the knife tool (K).
I know it’s a pain, but if you made bad geometry your going to spend a while fixing it.
This is not an add-on, but if you first select all the vertices you want in order and then run this script in the text editor, it will connect them in pairs.
import bpy
import bmesh
obj = bpy.context.object
data = obj.data
bm = bmesh.from_edit_mesh(data)
v = [s.index for s in bm.select_history if isinstance(s, bmesh.types.BMVert)]
if len(v)%2 != 0:
print('Not a multiple of two')
else:
for i in range(0,len(v),2):
bpy.ops.mesh.select_all(action = 'DESELECT')
v1, v2 = bm.verts[v[i]], bm.verts[v[i+1]]
v1.select = True
v2.select = True
bpy.ops.mesh.vert_connect_path()