Hi everyone, I’m trying to automate the creation of a facial rig.
For the eye, I followed this great tutorial: https://www.youtube.com/watch?v=-rtys3vFmso&t=30s.
I’ve finished writing the code for the structure, and now I’d like to apply clean weighting to the area around the eye.
Since in this rig each vertex along the eye’s edge loop has its own joint, my plan is as follows:
-
Identify the vertex associated with each joint (fig.01)
Fig.01 -
For each identified vertex, expand the selection by a given number of vertices and create an ordered list of vertices for each branch (fig.02)
Fig.02 -
Once all branches have been defined, apply the vertex weights for each branch in an orderly manner. For example:
branch_01 = (vtx[0], vtx[1], vtx[2], vtx[3], vtx[4], vtx[5])
vtx[0] = [(“eye_joint”, 1.0), (“main_joint”, 0.0)] # first vertex weight
vtx[1] = [(“eye_joint”, 0.8), (“main_joint”, 0.2)] # second vertex weight
vtx[2] = [(“eye_joint”, 0.6), (“main_joint”, 0.4)] # third vertex weight
vtx[3] = [(“eye_joint”, 0.4), (“main_joint”, 0.6)] # fourth vertex weight
vtx[4] = [(“eye_joint”, 0.2), (“main_joint”, 0.8)] # fifth vertex weight
vtx[5] = [(“eye_joint”, 0.0), (“main_joint”, 1.0)] # sixth vertex weight
or driven by a formula that automatically assigns the weights (fig.03).
Fig.03(For clarity, I haven’t labeled all the vertices in the pictures)
Of course, this is just the approach that came to mind based on my experience. I’m not sure if there are simpler or more efficient methods, so I’d really appreciate hearing other perspectives.
However, if I proceed with this approach, my issue lies in step 2.
After identifying the first vertex, how can I ensure that the selection of subsequent vertices follows the correct direction along the intended edge loop?
I’ve tried several solutions, but none of them have proven to be truly reliable. Does anyone have suggestions or alternative approaches?
(I hope I’ve made myself clear, and I apologize if this was too long.)


