Warning: Don't use this script. A bug causes it to render incorrectly.
This is a Python script for Blender that allows non-spherical eyes to track an object. It's useful for cartoony characters with flat eyes.
Tested with Blender 2.42. No external Python libraries are required.
See this example scene.
Setting up:
The script creates three helper objects to transform the eye:
Location / Rotation ControlUsed by the animator to adjust the position and rotation of the eye when it is at rest.
This control is the parent of the eye and the following controls. Its transform defines the reference space.
TrackerIndicates the direction that the eye is pointing. The animator may use it to adjust the tracking influence with the regular Blender tracking interface.
You'll probably want to set the influence to about 0.5, because an influence of 1.0 looks a bit unnatural.
Scale ControlUsed by the animator to squash the eye. Actually, this can be used to apply any secondary transformation.
Removing:
The script works by transforming the eye twice:
Effectively, the eye inherits the rotation of the Tracker, but the scale of the Scale Control.