View Full Version : Orient to Camera Script
Paulumbo 03-03-2005, 06:48 PM I need to orient a layer to the camera, that is to always make it face the camera, but my camera has no orientation value's and no target, It has been animated using rotation and position only.
Any ideas on how to write an expression to do this, or where I can get example script tutorial etc.
|
|
Shinjipierre
03-03-2005, 09:35 PM
www.motionscript.com
humm for your problem...
try this expression.....
[camera.rotate[0],camera.rotate[1]+90,camera.rotate[2]]
I'm sorry I can't open AE for now I don't know if this will work
Paulumbo
03-03-2005, 10:35 PM
Thanks for putting me on the right track, I thought it would have required a much more complicated approach, I couldnt get your script to work, but I nailed it like this:
myOrientationX = thisComp.layer("Camera 1").rotationX;
myOrientationY = thisComp.layer("Camera 1").rotationY;
myOrientationZ = thisComp.layer("Camera 1").rotationZ;
[myOrientationX, myOrientationY, myOrientationZ]
I actually wanted to just affect the Layers Y Orientation axis so I did this instead:
myOrientationX = 0;
myOrientationY = thisComp.layer("Camera 1").rotationY;
myOrientationZ = 0;
[myOrientationX, myOrientationY, myOrientationZ]
Out of Interest, the way you wrote the script seemed a lot less long winded than my script, is there a better way to write this?
Shinjipierre
03-04-2005, 03:21 PM
[0, thisComp.layer("Camera 1").rotationY, 0]
;)
Paulumbo
03-04-2005, 06:33 PM
That one works, and lots shorter! I think I understand the syntax now!
CGTalk Moderation
03-04-2005, 06:33 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.