How ugly are we talking? No cheap hacks?
I’m still curious to figure this out — I saw a post on here where I think you laid it out for someone else, but I couldnt figure out how to put the code into practice. (Was confused as to which names of which entities needed to go where)
Is this it:
L = comp("Pre-Comp").layer("FOLDING SIDE");
CL = thisComp.layer("Pre-Comp");
u = CL.toWorldVec(L.toWorldVec([1,0,0]));
v = CL.toWorldVec(L.toWorldVec([0,1,0]));
w = CL.toWorldVec(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 = Math.atan2(u[1],v[1]);
c = 0;
}
[radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]
Got that from here : https://forums.creativecow.net/thread/227/10169