Eyes Help

Well, I’ve got the following situation, a cartoony character whose eyes are not Sphericall. Therefore the eye object does not rotate when he glances, Instead, the black circle in the middle of the eye moves.

The thing is that I can’t get it done. I’ve tried assigning another obeject’s coordinates to the eyes (tried with an Empty, a Plane, etc), but the results are not correctly displayed in the viewport, so I cannot possibly animate the eyes with this technique, and the projection is not as predictable as it could be.

Is there a way to link an object or bone rotation values to the offset values of the texture coordinates??

Could you use a bone through the eye, name d to the texture object mapping? Then you could see the location of the pupil visually?

Maybe it won’t work, I’ll see if I can do it.

I have made this mistake many times

use a lattice to shape the eyes(and eye lids)
then when you rotate the eyes and lids they will deform

  • there still might be a few tiny adjustments of verts (depending on the shape)
    but it is usually the case of having to move one or 2 verts

edit:
you could maybe use a bone and parent an empty to it (the empty will be the pupil mapped to the eye)

Waylow is right - it worked only when I used the empty parented to the armature, and the armature parented to the sphere. I set the texture to map to the empty, and then moved the bone around and scaled it, and got some decent results.

http://www.4shared.com/file/22766143/cfc9f06c/eyearmatureempty.html

Here is a silly little example of what I did. :smiley: Maybe too simple for your use, but I did find out it was better to add the armature from front view, with the cursor still on the sphere’s center - so i learned something :slight_smile:

Thanks guys.

I’ve set up everything like Craigo said, but it doesn’t work for the shape of the eye of my character, because at some points the flat mapping just stretches to infinitum…

I think I’ll try to make some actions with the offset values and drive them with the action constraint…The only drawback is that I think that I will not be able to make the pupils roll over themselves, you know, like a dizzy effect, as there are no values for mapping rotation…or are there any rotation values somewhere that I did not see?? As far as I can tell there are some OFFSET and some SIZE values, but not rotation values…

Okay, so I didn’t understand - I set up a bon to visually control the empty that was named as the locator of the texture for the pupil - I think you could then also use a lattice for the stretching, if you could get the lattice to be controlled by the bone.

nonono, the stretching issue is a texture mapping problem. As the best projection method for this case is FLAT mapping, the texture stretches when the Empty moves towards the object rounded boundaries. This could be solved by rotating the Empty object, so that the projection matches somehow the direction of the eye object’s normals in certain places. But, as I don’t get viewport preview, it is just unpredictable.

Anyway, I tried going for the action constraint thing, but now I realize that Material keys are not recognized by the action editor…so, there’s no use for the action constraint…Am I wrong?

Isn’t there a way to link an object’s values to another object’s values, for instance, linking the rotation of an object to the texture mapping offset values of a material???
Maybe there’s a script for doing this??

Okay, but I am a little lost here - you have more understanding of rigging and constratints, so I may be messing you up.
I used the bone and empty in object mode, with the shift-p window over the area, so I was able to key loc/rot/scale on the bone in pose mode. The iris only stretched when I was scaling the bone, so I wonder what yours is set to.

I have to go into town, but I’ll check back later tonight. Sorry I can’t help more.

I am a bit confussed also by what is happenening for you
but I think what you are saying is the the pupil (mapped with empty) is stretching when it gets to the edges (goes around the corner)

maybe you could track the empty to the bone, so that
the z axsis is always pointing to the surface

anyway
I have made you a lattice deforming eye - for you to play with
(NB: you have to apply the lattice before you deform your eye - that way it is deforming a sphere not a ireggular shape)
http://thewaylow.googlepages.com/testeye.blend

hopefully this technique will work for your situation

maybe you could track the empty to the bone, so that
the z axsis is always pointing to the surface

Waylow, I’m confused - isn’t that what I did? The only reason my texture changed size was because I scaled the bone up and back down… I thought I did that. Weird.
Thanks for the lattice example, I’ll download that as well. :slight_smile:

I did it!!!

I can’t believe it, it’s been a looong and hard day today…

Thanks a lot for the help guys, really.

Well, this is how I did it:

_First of all, mapping the texture with the Empty’s coords only allowed the use of a 2d texture, as to say, a bitmap.
By using a bitmap you have to PROJECT the image over the surface of the object. Well, as you know, there are four ways of projecting, FLAT, CUBE, CYL, and SHPERE. Well, the best results were achieved with Flat projection. But as I said, flat projection made the texture stretch because the surface of my object is not spherical, so, the distance from the surface to the center of the object is different for each face.
The further the face is from the center the wider the projection. And having this deformation as a result was not the idea.

SO, I realized that the only way to prevent this stretching was to use ORCO mapping, and this kind of mapping work great with PROCEDURAL textures (which use 3d Space, and therefore don’t need UV mapping).
BUT, Empty objects do not seem to have 3d texture coords. Therefore I replaced the Empty with a SPHERE.

And there you got it!! the ORCO coords of the Sphere flawlessly mapped the procedural made pupil over the surface of my character’s eye object!!

Here’s the Blend file.

http://jpbouza.com.ar/downloads/craigowaylow-eyes.blend

thanks a million guys!!

I’m proud Waylow and I made it to the title of the blend, but the link doesn’t work for me - part of the link isn’t alink, and I tried again to type up the link and I couldn’t get it.
Glad to hear we helped - and very interesting thought process that solved it - congratulations!!:smiley:

Now it should be working…

Thank you!!!

Oh I was forgetting, still no viewport preview, but I’ll solve that issue by using some kind of proxy object, no big deal.