After Effects Auto-Orient Expression

We recently had a project using motion paths where we wanted to auto-orient an object (an arrowhead) as it moved along in the direction of the path. After Effects has a Layer/Transform/Auto-Orient… command that allows you to do this. However, when using expressions to drive the motion combined with floating keyframes we noticed that the arrow would freak out and point in a random direction briefly in some spots. Since there are no options associated with auto-orient you have three options: change the way you’re animating to make auto-orient work, manually keyframe the rotations, or use expressions to make your own and better auto-orient.

A little fiddling and brushing up on my trigonometry got me to the following expression that works much better than auto-orient plus allows some easing into and out of sharp corners for a more natural motion. A little fiddling and brushing up on my trigonometry got me to the following expression that works much better than auto-orient plus allows some easing into and out of sharp corners for a more natural motion.

This expression assumes the default orientation of the object you want to orient is 0° North (pointing up.) You’ll need to adjust it otherwise. Next step I think I’ll try to roll this into a plugin if I can figure out the AE plugin SDK.

This entry was posted in blog and tagged , , . Bookmark the permalink.

7 Responses to "After Effects Auto-Orient Expression"

Leave a reply