Page 1 of 1

creating "rigged camera" via scripts

Posted: November 17th, 2005, 3:36 pm
by 4eyes
Hi there,

Trying to write a script which creates a new Camera, a null with slider and angle expression controls, and then expressions on the camera's position and rotation properties which are referencing the slider controls on the null.

I've gotten this to work manually following other posts elsewhere on this forum - and here's what i do:

First I create a null object and call it "MOVER". to that i add 3 slider controls, called Pos X, Pos Y, and Pos Z. then i create 3 angle controls called Rot X, Rot Y, and Rot Z.

After that I create a camera and put this expression on its position:

w = thisComp.width/2;
h = thisComp.height/2;
d= (-900);
x = thisComp.layer("MOVER").effect("Pos X")("Slider")+w;
y = thisComp.layer("MOVER").effect("Pos Y")("Slider")+h;
z = thisComp.layer("MOVER").effect("Pos Z")("Slider")+d;
[x, y, z];

and on the orientation goes:

x = thisComp.layer("MOVER").effect("Rot X")("Angle");
y = thisComp.layer("MOVER").effect("Rot Y")("Angle");
z = thisComp.layer("MOVER").effect("Rot Z")("Angle");
[x, y, z];

Anyone know how I could script this?
Thanks!

Posted: July 13th, 2006, 10:44 am
by bradshaw1965
I'm not sure if Kyle is still checking for this script, but I went ahead and gave this one a shot. I posted the results here...
http://www.creative-workflow-hacks.com/ ... r-effects/

Hope it's still useful.