OK. I've got that up and working. I gave the null object motion
path a loopOutDuration so that I could have the driver go around and around the
track. Now the next problem I'm trying to squash is how to get the object to
auto-orient around the path. Normal auto orientation doesn't seem to be working
since it's grabbing it's position from the slider instead of position.
L
= thisComp.layer("other layer");
u
= fromWorldVec(L.toWorldVec([1,0,0]));
v
= fromWorldVec(L.toWorldVec([0,1,0]));
w
= normalize(fromWorldVec(L.toWorldVec([0,0,1])));
sinb
= clamp(w[0],-1,1);
b
= Math.asin(sinb);
cosb
= Math.cos(b);
if
(Math.abs(cosb) > .0005){
c = -Math.atan2(v[0],u[0]);
a = -Math.atan2(w[1],w[2]);
}else{
a = (sinb < 0 ? -1 : 1)*Math.atan2(u[1],v[1]);
c = 0;
}
[radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]
I'm not sure how to pass the value from the original expression over to the
auto-orientation expression. My initial thought was to pass the value derived
from the first expression over to L in the second expression. But watching what
happens to L in the equation it seems like it wants the layer itself to pull
coordinates from After Effects world space. Any suggestions?