hi
may be this is a noob problem but I can’t do this:
I begin with a triangle… vv1 ,vv2 ,and vv3 are the triangle’s vertex and vv4, vv5 and vv6 are vertex that my script will be add
I use the bmesh.ops.connect_vert_pair in order to connect the vertex and this work! connecting all vertex at the same time:
bmesh.ops.connect_vert_pair(bm, verts=[vv1, vv4])
bmesh.ops.connect_vert_pair(bm, verts=[vv2, vv5])
bmesh.ops.connect_vert_pair(bm, verts=[vv3, vv6])
the worry is begin if I want to select which vertex connect…I thought that this was a easy “if else”… but NO!:
if seleccion1 and seleccion2 == False and seleccion3 ==False: bmesh.ops.connect_vert_pair(bm, verts=[vv1, vv4])
elif seleccion2 and seleccion1 == False and seleccion3 == False:
bmesh.ops.connect_vert_pair(bm, verts=[vv2, vv5])
elif seleccion3 and seleccion2 == False and seleccion1 == False:
bmesh.ops.connect_vert_pair(bm, verts=[vv3, vv6])
elif seleccion1 and seleccion2 and seleccion3 ==False:
bmesh.ops.connect_vert_pair(bm, verts=[vv1, vv4])
bmesh.ops.connect_vert_pair(bm, verts=[vv2, vv5])
elif seleccion1 and seleccion3 and seleccion2 ==False:
bmesh.ops.connect_vert_pair(bm, verts=[vv1, vv4])
bmesh.ops.connect_vert_pair(bm, verts=[vv3, vv6])
elif seleccion2 and seleccion3 and seleccion1 ==False:
bmesh.ops.connect_vert_pair(bm, verts=[vv2, vv5])
bmesh.ops.connect_vert_pair(bm, verts=[vv3, vv6])
elif seleccion1 and seleccion2 and seleccion3:
bmesh.ops.connect_vert_pair(bm, verts=[vv1, vv4])
bmesh.ops.connect_vert_pair(bm, verts=[vv2, vv5])
bmesh.ops.connect_vert_pair(bm, verts=[vv3, vv6])
else:
print("escoja vertices de origen")
using this checkbox idea if I select 1 option the script work, BUT with 2 or 3 option selected that is the error…
vv4, vv5, and vv6 has the same code structure, for example:
verticenuevo2 = [v for v in bm.verts if (v.select==False and not v.hide)] for vertice2 in verticenuevo2:
vv5 = vertice2
vv5.co = coordenanuevaarista2
vv5.select = True
do you have some ideas???
thanks
Diego