(I know this post is pretty old, but I’ll post some expressions here if anybody else is trying to find answers.)
I use these expressions to control my characters eyes. They are based on Daniels Gies great work.
The first expression (PUPIL FOLLOW OBJECT) is a setup for the pupil layer to move around in accordance to the motion of the OBJECT.
The second expression (PUPIL FOCUS) makes the pupils move closer and further apart (by manipulating OBJECT’s x-scale) and move them contrarily vertically (by manipulating OBJECT’s y-scale).
If the pupils and eyes are mounted on a head, and this head moves or rotates, the eyes will be stuck in the same position relative to the head. In other words; they will not point towards the OBJECT any more! Therefore it might be a good idea to mount the OBJECT to the head to always make the eyes positions relative to the OBJECT.
So it’s not perfect, but it’s at least a much easier way of controlling the eyes of your character.
// PUPIL FOLLOW OBJECT - Copy expression to pupil-layer/Transform/Position
// OBJECT is name of layer to follow, replace with correct name
a=thisComp.layer("OBJECT").transform.position;
transform.position+a*5/30; //Multiplier, calibrate to you liking
// Place OBJECT right between the eyes and move pupils to correct position
// PUPIL FOCUS - Copy expression to pupil-layer/Effects/Transform/Position
// Set pupil layer/Effects/Transform/Anchor Point to 0,0 to reset position
// OBJECT is name of layer to follow; replace with correct name
// DISTANCE is a Slider Controller in OBJECT-layer; replace with correct names
a=thisComp.layer("OBJECT").transform.scale[0]; // Link to OBJECT x-scale,
b=linear(a, 100, 300, [30,0], [-30, 0]); // Calibrate to your likings
c=thisComp.layer("OBJECT").transform.scale[1]; // Link to OBJECT y-scale
d=linear(c, 100, 300, [0,30], [0, -30]); // Calibrate to your likings
b+d // For opposite eye: -b+-d