ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Changing active camera

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dwayne Parnell
Changing active camera
on Feb 2, 2010 at 5:14:35 pm

I'm looking for a way to switch the active camera via expressions. Right now I have keyframed the opacity of a null object layer and I've tied several layers' opacity to that - but I just can't find any way to make a camera layer active/inactive, or change the order of the cameras.

My ideal solution would be to use markers: each marker would switch camera angles.

Any ideas?


Return to posts index

Kevin Camp
Re: Changing active camera
on Feb 2, 2010 at 7:06:38 pm

i don't think you'll be able to do it with an expression...

the only way i know how to change the active camera in a composition, is to reorder the cameras (drag one above the other), show/hide a camera or trim the camera layer (drag the in/out points). and none of those options are available to expressions.

you could probably find/write a script that would modify the in/out points of the cameras based on layer markers, but if you don't know java, it may easier to trim each camera by hand. also, say you cut from camera 1, you won't be able to cut back to it since a layer can't have multiple in/out points. in a case like that you'd need to have multiple camera 1's in the time line.

if you have many cameras, you may be better served to render each shot, then edit the shots, preferably in an nle.

Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index

Dwayne Parnell
Re: Changing active camera
on Feb 2, 2010 at 8:20:54 pm

I was afraid of that.

Time to learn scripting!

(Thanks for your input.)


Return to posts index


Dan Ebberts
Re: Changing active camera
on Feb 2, 2010 at 8:58:53 pm

This is a fun one, although it may be more trouble than it's worth. Just apply this expression to every property of the top level camera that you care about. When you want to switch cameras, drop a layer marker on the top level camera with the target camera's name as the comment. It seems to work very well, although I've only tried it on a few properties. If the comment on the most-recent previous marker isn't the name of a camera (or there are no markers) the expression reverts back to the value of the top level camera. Good luck!

n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
}
if (n > 0){
cameraName = marker.key(n).comment;
try{
propGrpName = thisProperty.propertyGroup(1).name;
propName = thisProperty.name;
thisComp.layer(cameraName)(propGrpName)(propName).value;
}catch(err){
value
}
}else{
value
}


Dan



Return to posts index

Dan Ebberts
Re: Changing active camera
on Feb 2, 2010 at 9:06:50 pm

This may be even less useful than I thought. It won't work if the cameras have parents.

Dan





Return to posts index

Dwayne Parnell
Re: Changing active camera
on Feb 2, 2010 at 10:33:48 pm

here's what i did.

i created 2 cameras; FRONT and OTS (over the shoulder)

FRONT is always on at the bottom of the stack.

I made a copy of OTS called OTS2 and tied all of OTS2's properties to OTS.

I made several duplicates of OTS2 to play with.

I have several 2D layers that serve as backgrounds and foregrounds for the 3D stuff. I switch them on/off by tying their opacity to thisComp.layer("FRONT").active

I don't like having all those duplicate cameras, but it works fine.

Yhanks you guys for your insight.


Return to posts index


Kevin Camp
Re: Changing active camera
on Feb 2, 2010 at 10:42:05 pm

that's pretty cool dan.

i think if you knew you were going to go this route, you could often work around the parenting issues.

Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index

Peter Koenen
Re: Changing active camera
on Feb 20, 2011 at 7:52:24 pm

For those who are still searching for an answer, I got this solution.

Create a main Comp where you put all your content.


Then make two comps for the cameras. In those comps you put your main comp and a camera layer.



Be sure the 'Collapse Transformations' option is selected (gear icon) so the 3d layers from the main comp remain 3d in the camera comps and you can animate your camera in 3d.


Now make a Mix comp where we will mix/switch the cameras. Put the two camera comps into the mix comp.




Now your cameras are two comp layers so it's easy to switch cameras with opacity, or use both cameras at the same time and animate them.


Return to posts index

Mike Gauer
Re: Changing active camera
on Jan 2, 2013 at 4:46:03 am

Peter,

I'm a long time reader of this forum, but until now, I have never registered.

I registered solely to reply to this forum and say thanks! Your screen capture explanation was not in vain and you just saved me a ton of time! I have a multi-cam set up with quick changes, and it's a very complicated composition with several hour render times, and without your neat trick I would have had to do the usual extra work in composing all the angles (and griping that you can't switch between cameras in AE!)

You're the man!


Return to posts index


Nuwan Thilina
Re: Changing active camera
on May 7, 2018 at 1:47:58 am

Hello there, I have found another simple solution today.

01. Let's assume that we need 1 minute time for each camera. We have 10 different cameras to switch between.

02. Create new comp "all cameras" with 10 minutes duration. Put camera layer 01 from 0mins - 1mins.
Second camera layer 1mins - 2mins. Follow similar way for all 10 camera.

03. Then create another new comp " Final". Time duration of 1 minutes.

Then add "all camera" comp in to it and trim that comp 0 -1min (which contains first camera)
Then trim it again 1-2 mins. continue this until 10 mins. Now you get 10 comps.

You can simple switch camera using opacity or linking opacity to checkbox expression now.

I tried to explain it well. But english is not my first language. Sorry for any errors. Let me know if anything is not clear.

Cheers.
Nuwan T.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]