-
Rotate away from Camera problem
I’m hoping that someone can spot the error in my script. I have series of layers that rotate as the camera approaches. Some should rotate clockwise others counter clockwise. The start and end rotations as well as the angle are set by expression controls on a master layer. My problem is that the counter clockwise and clockwise rotations are not in sync. I’ve brute forced a solution but it bugs me that I don’t see the reason I need to. There must be an error in the script that eludes me.
Here is my script for the cc rotation (applied to the Y axis):
startR =effect(“Rotation Start Distance”)(“Slider”);// start rotation in pixels from camera
endR = effect(“Rotation End Distance”)(“Slider”); // end rotation in pixels from camera
C= thisComp.activeCamera;
P = length(toWorld(anchorPoint),C.toWorld([0,0,0]));
endAngle = effect(“Angle Control”)(“Angle”);
ease(P,startR,endR,endAngle,0)The clockwise script:
//ROTATE CLOCKWISE
startR =thisComp.layer(“Master”).effect(“Rotation Start Distance”)(“Slider”) + 100;// start rotation in pixels from camera
endR = thisComp.layer(“Master”).effect(“Rotation End Distance”)(“Slider”); // end rotation in pixels from camera
C= thisComp.activeCamera;
P = length(toWorld(anchorPoint),C.toWorld([0,0,0]));
endAngle = (thisComp.layer(“Master”).effect(“Angle Control”)(“Angle”)*-1)// INVERT VALUE;
ease(P,startR,endR,endAngle,0)You’ll note that I’ve forced the clockwise to behave by adding 100 to the startR value. I have no idea why I need to…