Auto-Orient Along Path

Analogue of the standard “Transform > Auto-Orient“, but created using the expression and the ability to adjust the degree of smoothness of the rotation animation.

try{
cornerEase = 3;
p = transform.position;
t = Math.min(Math.max(time,p.key(1).time+.001),p.key(p.numKeys).time);
pre = position.valueAtTime(t-thisComp.frameDuration*cornerEase);
post = position.valueAtTime(t+thisComp.frameDuration*cornerEase);
delta = post-pre;
orient = radiansToDegrees(Math.atan2(delta[0],-delta[1]));
value+orient+180
}catch(err){value}
Recommended Posts

Start typing and press Enter to search