HowTo: loopcut in script?

How do I do a loop-cut in a script?

by manually performing a loop cut

as in, given two verticies, search for the faces that have the two verticies adjacent, then given their opposite pairs of verticies do the same thing as long as you are looking at quads

then add verticies in between each of these pairs, and create new faces using them and the original ends… and delete the original faces.

to make this run remotely fast enough you’d need to not use NMesh, at least directly. Going through the faces and storing the edges in a dictonary [as keys, a 2-tuple of nmvert refrences] and a list of faces in which the edge is used as the value. Store using both combinations of verts [(vert1, vert2) and (vert2, vert2)] just in case.

if you want a loop cut that isn’t in the center, the logic is a bit more complex, but not really.

Thanks! That is a nice guideline, I will try it out.

Fot examples of throwing faces around see my skin tool- at my homepage,