Home Youtube GitHub

Eye Rigger problem


#1

Hi again mGear guys,

I have an issue with the Eye Rigger.
When I check off the manual corner vertices, the rig builds but the corners aren’t right.
When I check them on, the rig builds incorrectly and messes up the lower and upper eyelids and the entire ability to blink.

See attached video for details:
Eye rigger issue

I’m using mGear 3.1.1
The eye is round and the pivot is in the center, only the iris and pupil are elliptical.

What do I do?

Thanks a bunch!


#2

Hi Tsahi,

At first, I thought that even though you are specifying the corner vertices, the eye_rigger might still need those corners to be on the outside boundary of the eye. But I just did a quick test, and moved some vertices out further than the corner, and it built fine.

You shared a video, but the one thing I would have double checked is the vertices you chose. And you skipped that part. haha Ah you did show that!

So can you triple-confirm? Do the vertices you chose lay on the same edge loop as your blink edge loop?

Can you do a fake test, and just pull the vertices of your eyelids so that the corners are at the edges of the eye? If you do, does it build as expected?

If no, then maybe there is another bug to find.
If yes, then maybe we can tweak the eye_rigger code.

Would you be willing to share your geometry for a test? Even if it is just a chunk of the eye area, cut out from the head?


#3

Thanks for replying Chris.

I show the vertices I defined in the video at around 00:40-00:45.

I’m not next to it right now, but I’ll upload the mesh later, and test the vertices move.


#4

I tried moving the vertices towards the eye and running again. It didn’t work.

Here’s the relevant mesh part:
eyes mesh parts


#5

That seems to be a video link.


#6

Sorry, it was late at night.
Updated the link above.


#7

Well, I have some strange news. It worked on my end, as far as I can tell. Here is my config, so you can verify I’m using the correct edge loops and vertices for your test mesh.

I made a joint “joint1” for the “Head or eye area Joint”

blinks_test

{
    "eye": [
        "skin_L_Eye", 
        "headShape.e[72],headShape.e[73],headShape.e[74],headShape.e[75],headShape.e[76],headShape.e[77],headShape.e[78],headShape.e[84],headShape.e[85],headShape.e[86],headShape.e[87],headShape.e[89],headShape.e[92],headShape.e[93],headShape.e[101],headShape.e[107],headShape.e[112],headShape.e[118],headShape.e[133]", 
        0.2, 
        "eye", 
        0.05, 
        1, 
        2, 
        "joint1", 
        true, 
        "", 
        "ctl", 
        false, 
        true, 
        "headShape.vtx[60]", 
        "headShape.vtx[53]", 
        "", 
        ""
    ]
}

#8

The thought of this happening has crossed my mind. :confused:
So what do I do?
I think perhaps I can try to create the eye rig with this mesh and then skin the real eyelids of the real mesh manually.
Since my head mesh already has a skin I won’t be able to copy the skin from this mesh, or maybe I could transfer weights from an NG layer on it to an NG layer on the head mesh?! :thinking:

I hope the problem I experience is not related to the biped rig I already have built.

Is your script something for me to use? If so, I’m not sure how to use it.

Thank you!


#9

For now, I suggest to just double check the edge loops and vertex numbers. Maybe I chose different components than you?

The script is just the JSON that exports when you hit “Export Config to json” which lets you save the edge loops and vertices and run it again each time you build your rig. Instead of running the GUI tool each time. (In a future version of mGear, you’ll be able to load that config file directly into the GUI. Currently, you have to run it from a script.)

Yes, you should be able to use ngSkin to transfer this skin. I do that all the time, so I can merge in my eye weights! It works quite well.


#10

I’ll have to check the edges and vertices visually between the mesh I gave you and the full head one, as the ID numbers changed when I extracted the partial mesh.

Thanks, man.
We’ll see if this leads to a solution.


#11

Well… No.

I suggest you check the exact same numbers as me on the partial mesh you sent me, and see if it runs on your side. Then we can see if it is the mesh, or a bug in the script on your side.


#12

I tested on the partial mesh and it worked.
So it’s probably a problem with my full head mesh, although I don’t know why,
I created the partial one by extracting faces from the full one (+delete history).


#13

Yeah that is bizarre. And the other difference is that you have a full rig in the scene. So maybe check for conflicting names. Do your body geometry, eyeball, eye joint and eye rig group all have unique names?

Are you getting any suspicious looking errors or warnings in the script editor output?


#14

Hey guys,
I had the same issues, it happened when the eye corners were aligned that way. (my mesh was even more stylized (cartoon rinho).

Same - better results with eyelids separated, but I as the deadline was coming, I ended rotating the eye with some root so It was as straight as possible, and then rotation back the rig. <- yep, not so clever. But after digging into the code, I think it would be nice to add a few options to set the orientation of the whole rig. I started working on that, but it’s not ready yet and not sure when would have time to finish it.

Also, I have always better results creating separate geo (just 1 edge) just to generate eye/lip rigs.

Cheers!


#15

Hey guys,

I tried to take the alternative approach of building the eye rig on the partial mesh and then either transferring weights or skinning the real head from scratch.
But I encounter several issues with this.
I managed to rig the left eye, just like Chris tried successfully, and it’s connected to the main character rig.
But whatever I do, I can’t get the right eye to rig properly. I even tried opening a clean file only with the partial mesh and creating the eye rig, with a simple joint1 as “head or eye area joint”, but whatever I do, the right eye rig doesn’t build properly and doesn’t blink correctly. The joints rotate around the eye socket when blink is on.

The second weirdness I’m experiencing is that the eye rigger window freezes. For example, I select the eye mesh and press it in, then the edge loop but I can’t press the edges button (the << one), or type text in the text box, for a while. Then I get a // Warning: Python callback failed // in the script line and it unfreezes and I can carry insert the edges, then freezes, insert inner vertex, etc…

Chris, is there any chance you could test if you can build a right eye in that same file you tested before?
I’d really appreciate it.

I’m kind of at a loss here and starting to consider not to use the eye rig at all.

Thank you!


#16

Yep, it is funky on the right side.

right_blink

The blink blendshape curves are all twisted and mangled.
image

The upper eyelid is an upper curve:
image
The lower eyelid is going all the way around the eye! Which is just wrong. The interpolation between those two curves is the mangled blink we are seeing.
image

At first, I suspected it was because the edge loop you are selecting doesn’t really have any neighbors. But I chose the next one out, and it still acts the same.

Also, the first time I built the eye, I got a different result, and the center of the eye got calculated incorrectly, halfway down the body. I built it a second time with the exact same config, and it worked as pictured.

I also tried subdividing your mesh, in case it was a problem with low density messing up some of the mesh calculations. The results was the same.

Lastly, none of this explains your weird GUI freezing. I ask again, are you seeing any errors in the script editor?


#17

I’m pretty busy right now, but I can try digging into the code within a week or three. There are some solveable bugs here, for sure!

In the meantime, I offer you a hack to consider:

  1. Rotate your mesh group so your corners are on the outsides
    image
  2. Run the script
    image
  3. Temporarily turn on Dual Quaternion weights so the eyelid stays nice and round
  4. Close the blinks
  5. Save and export that shape as a blendshape, and use it as a blendshape on your rig.

You could also move some of the other eyelid-shaping controls and save those as blendshapes too.


#18

Thank you for all the testing and advice. I really appreciate it.

I didn’t get any weird errors in the script editor about running the rigger.
The one thing I did get: when I tried running a right eye after the left was already created, I got an error that the right eye’s area joint (or eyeOver…) is not part of the skin cluster.
This error doesn’t happen when you rig the first eye, but once you do, it pops up when rigging the second eye.
Unless you go ahead and ad that joint’s influence before running the rigger for the second eye.

Well, if it comes down to blendshape blinks, on such a low poly mesh I can create them really fast and appealing without all the eye rigger workaround. Not too many vertices to move here, and I’ve creates such blendshapes many times.
I’ll also need blendshape inbetweens for the eyelid to go around the eye and not through it when the blink is halfway through.

I’m familiar with SHAPES but never used it so far, but I’ve been using a fantastic little script called abSymMesh for years. It checks symmetry, let’s you flip you blendshape, mirror sides, etc…


#19

Hey,

I’ve tested your file and it’s working well. I’m using mGear version: 3.1.1.
Please take a look, maybe you could just reparent that rig into your file. Rig was created from your geo, but when it fails, I would recommend you create temporary geometry, so that you’re sure it clean etc.

I can’t be sure about this, but when I was digging into the code some time ago, sometimes I found that edge loops given to script are not sorted in some cases. I’ve fixed that adding sorting function in one of my scripts (based on lips rigger).
I will try to check that also.

About blendshapes -> shapes was the best plugin I’ve ever used, it saved me a ton of time. Not sure if you’re using radialblendshape, but if not I will recommend that also. Gives a little more control out of the box for a simple blendshape setup.
https://www.paolodominici.com/products/zvradialblendshape/


#20

Yeah this is a nuisance, but the way I handle the eyes, is that I use the GUI tool to get my JSON configuration file. I build one eye at a time, and then export the weights as ngLayers to be merged into my body weights later.

Once you have the config file and the weights, you don’t need the GUI tool anymore, and you can turn off auto-weighting on the eyes. I load my eyes configs through scripts, and the weights get stored in the Skin Pack file.