Eye position setup

I’m attempting to add eye posing to a model of mine, following Valve’s eye position setup guide. However, my particular model’s eyes are positioned in such a way that I’m not sure where to put the eye spheres, since I don’t know how the iris projection works exactly.

Front view


Side view

As you can see, the eye is slanted and sort of on the side of the head (I’m not worried about the angle since there’s already a QC parameter for that). My attempts at positioning a sphere in this eye ends up with either a sphere that sticks beyond the eye’s surface or doesn’t cross the full width of the eye. Here’s one attempt at positioning a sphere:

Front view with sphere
[media]http://img210.imageshack.us/img210/1238/eyefrontsphere.png[/media] [media]http://img34.imageshack.us/img34/8299/eyefrontspherewire.png[/media]

Side view with sphere
[media]http://img210.imageshack.us/img210/2783/eyerightsphere.png[/media] [media]http://img529.imageshack.us/img529/683/eyerightspherewire.png

Am I on the right track guys?

You’ve got the right idea.

However, it’s not the size of the sphere that matters with QCEyes; it’s its coordinates. As long as your sphere is in the ‘center’ of your eye, it should come out okay. If not, then just mess with the parameters in the model viewer until you get something acceptable.

Phew, that’s a relief. I’m not really using the QCEyes though; I was just going to figure out the numbers myself.

As for the center of the eye, does it matter how far inside the head it is? Am I OK with, say, picking that center vertex on the eye surface as my eye center?

You could, but I’m not sure how it would look or if there would be some distortion issues. I’d suggest putting them inside a little bit. If it doesn’t look right, experiment. Whatever works, works.

OK. Thanks.
Just one more question though.

When working on the eye flexes, would I fold vertices over the eyelid to make it closed or would I squash the eye itself?

I’m asking because I did the first method and the eyes look crumpled up in HLMV, so I was wondering if the second method is actually the norm.

Valve squashes the eye. I’d do the same.

OK. I tried that, but my eyes are still ending up crumpled.

This is what my eyes are looking like:


As you can hopefully tell, parts of the eye edge are not flush with the rest of the model. You can see right through the cracks.

I’m not sure if this has to do with my QC file or with how I’ve edited the shape keys (I’m using XSI).

This is what the eyeposing part of my QC looks like:

 eyeball righteye "ValveBiped.Bip01_Head1" -2.2443 -3.1785 67.3535 "eye_right" 1 4 "iris" 1
 eyeball lefteye  "ValveBiped.Bip01_Head1"  2.2443 -3.1785 67.3535 "eye_left"  1  -4 "iris" 1

 eyelid  upper_right "mymodel_expressions" lowerer 1 -0.5 neutral 0  0.42 raiser 2  0.42 split  0.1 eyeball righteye
 eyelid  lower_right "mymodel_expressions" lowerer 3 -0.5 neutral 0 -0.5 raiser 4 -0.06 split  0.1 eyeball righteye
 eyelid  upper_left  "mymodel_expressions" lowerer 1 -0.5 neutral 0  0.42 raiser 2  0.42 split -0.1 eyeball lefteye
 eyelid  lower_left  "mymodel_expressions" lowerer 3 -0.5 neutral 0 -0.5 raiser 4 -0.06 split -0.1 eyeball lefteye

Note that the values of 0.5 and -0.5 should actually be 0.54 and -0.54 respectivally, but it seems studiocompiler doesn’t like values greater than +/- 0.5.

Ha. Totally called what model it was.

Anyway, I don’t use XSI, so I can’t help you with that, but it looks like your eye vertices came unwelded or whatever the hell they call it in XSI. You might want to check those verts are welded, bound, merged or whatever. Even if the .vta screwed up, those vertices should move together.

I tried welding duplicate vertices (XSI calls it “filtering”). I’m not getting holes anymore, but the eye is still crumpled.

Left eye:


Right eye:

There’s also a plot twist: the controllers for eye closing (right_lid_closer and left_lid_closer cause the lower lids to raise instead of close the eye. I have no idea what I changed beyond remodeling the flexes to make the eyes collapse instead of have the mesh fold over them.

Other question: is there anyone in these forums who uses XSI for facial animation? Or is everyone just using Max?


I’ve fixed the crumpled eyelid problem. The thing with XSI is that when you initialize the shapekeys for facial animation using the Valve plugin, frame zero is a duplicate of frame one (remember that I’m following this guide). Changes to frame one affect frame zero. I was ignoring this at first, but since frame zero is supposed to be the neutral expression while frame one is for the character with her eyes closed, this seemed to be messing things up.

What I did to fix this is copy a frame with the neutral expression to frame zero (go to frame, select cluster for the face, ValveSource > Shape Tools > Copy Shape Keys). My character’s eyes look normal again.


However, the eye-close flex is a bit off. It’s hard to tell without it moving, but the bottom eyelid seems to fold over the top eyelid, and the forward part of the bottom eyelid seems to stretch backwards.

[media]http://img169.imageshack.us/img169/1600/weirdeyelid01.png[/media] [media]http://img179.imageshack.us/img179/816/weirdeyelid02.png[/media] [media]http://img514.imageshack.us/img514/2899/weirdeyelid03.png

This is what my eye code in my QC looks like now. This time, I tried positioning the eyes so that I won’t get values beyond +/- 0.5 in the eyelid code.

$attachment "eyes"  "ValveBiped.Bip01_Head1"  0.00 -3.20  67.43 absolute

$model "mymodel" "mymodel_reference.smd" {
    eyeball righteye "ValveBiped.Bip01_Head1" -2.61 -3.20 67.43 "eye_right" 1.00  4 "iris" 1
    eyeball lefteye  "ValveBiped.Bip01_Head1"  2.61 -3.20 67.43 "eye_left"  1.00 -4 "iris" 1

    eyelid  upper_right "mymodel_expressions" lowerer 1 -0.50 neutral 0  0.46 raiser 2  0.46 split  0.1 eyeball righteye
    eyelid  lower_right "mymodel_expressions" lowerer 3 -0.50 neutral 0 -0.50 raiser 4 -0.02 split  0.1 eyeball righteye
    eyelid  upper_left  "mymodel_expressions" lowerer 1 -0.50 neutral 0  0.46 raiser 2  0.46 split -0.1 eyeball lefteye
    eyelid  lower_left  "mymodel_expressions" lowerer 3 -0.50 neutral 0 -0.50 raiser 4 -0.02 split -0.1 eyeball lefteye



Ugh. Never mind. I fixed it by simply redoing the eyelid shapekeys (blanking them out by copying the shape of an unedited frame, then molding the mesh again).

Excellent job Guynumbers! I can’t wait to see a release or video soon! :v:

Nice, keep it up.


OK, in that case I can get a release out much faster if someone tells me how to get rid of these bands across the eyes.


Clamp the S and T in VTF Edit or Photoshop.

S and T are already clamped for both the iris and eye textures. :sigh:

Hmmm… have you tried saving without mipmaps? If that doesn’t work, I could take a look at the texture for you.

I think that did it. I opened my eye textures in VTFEdit and checked “No Mipmaps” on them. Thanks!


It has jigglebones now! Awesome.

Hey, that came out nice! Glad you got it working.

A winnar is you guy. Excellent job!