Website Youtube GitHub

Eye Rigger problem


#21

Hi @Krzym,

This is a super late reply, but this week I am looking into the eye code a bit more. What did you mean by “sorted”? I’m guessing sorting by edge or vert number will not work, since you can’t necessarily rely on those being in a nice order. (Or can you?)

I am testing an algorithm that will either orient itself to the axis of the corner vertices, or will march along the edge-loop, choosing the two middle points for the upper and lower vertices, so even 45 degree rotated eyes should work. This works for finding the vertices, when the user chooses manual corner vertices.

But I’m still trying to figure out why the right side sometimes loops all the way around the eye. I haven’t figured out where that is happening yet.

Edit: Actually, I have a promising result that seems to have fixed it when I override the upPos and lowPos verts in the eyes, but I am double-checking. This was a mesh I had that was failing on the right side, and now it is working, because I find the upPos and lowPos by edge-marching to the middle of the upper and lower eyelid edges. I’ll run this by the devs later this week and then make a pull request if it seems solid.

eyes45degrees


#22

Hi @chrislesage. I’m not sure what exactly is wrong, but sometimes it helped me to create temporary geo - then even 45 degree rotated eyes worked - only minus of that was that the controls weren’t rotated correctly as on your preview - do you think you could quickly fix that too? :wink:

What I was testing was sorting edges/verts by world position or from one corner to another. Sorry I do not have any examples right now, just some code I quickly pasted:

#sort vertices from X+ to X-
def sortVerts(points):
    length = len(points)
    for i in range(length):
        for j in range((i+1),length):
            pos_i = points[i].getPosition(space='world')[0]
            pos_j = points[j].getPosition(space='world')[0]
            
            if (pos_i < pos_j):
                temp1 = points[i]
                points[i] = points[j]
                points[j] = temp1
    return points


c_Loop = [pm.PyNode(e) for e in pm.polySelect(geoTransform, edgeLoopPath=(l_inner.indices()[0], r_inner.indices()[0]), ass=True, ns=True)
                  if pm.PyNode(e) not in l_Loop and pm.PyNode(e) not in r_Loop]

I’m sure this is not a clever solution but worked that time :wink:


#23

Thanks! Yeah that makes sense.

And yeah I’ll see if I can fix the orientation of the controls too. I’ll see if I can calculate a sane orientation space between the vertices.