Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Creating automatic camera moves with expressions

  • Creating automatic camera moves with expressions

    Posted by Patrick Hearn on September 7, 2006 at 4:37 pm

    Hi,
    I’m trying to create a project for my boss to do the following:
    Have a grid of images which the camera moves between smoothly.
    I could, of course, set this up with keyframes and it may well be easier, however he does want this to be something we can use in the future for different projects, so I thought it would be good to set up a project that would adjust itself without too much work.
    Very laborious to start but I’m hoping it saves workload and time in the future.

    Basically I need the project to allow me to replace placeholder assets with image or video assets, then have the camera already set up to smoothly move between each image and glide over it, wherever that image is placed.

    I’ve begun writing the expressions for the camera movement and as you may imagine it’s fairly heavy going.
    By the way I’m using AE 5.5 as I’m at work but if there’s solutions available in later versions I’m more than happy to hear them.
    The current problem I’m facing is initialising a variable which i change in the expression. It’s fairly hard to explain so forgive me if this makes no sense.

    *deep breath*
    The camera has a variable set up (state), which is either “view” or “move”. It also has PrevTarget and CurrTarget. When it is within the boundries of CurrTarget state is “view” and once it leaves them state is “move” when it reaches the end of the boundries of CurrTarget the value of CurrTarget is moved to PrevTarget and CurrTarget is advanced to the next one. The problem is…

    I have to refer to PrevTarget and CurrTarget to work out where the camera is and what state it should be in, also it neeed to start somewhere, so I have to initilise it, however, as the way this thing works is it runs the code every frame, if i have an initial state set there it reverts to that state every time.

    Ok. Very sorry about the long post. If anyone’s interested please leave a comment.
    Cheers

    Colin Braley replied 19 years, 8 months ago 4 Members · 5 Replies
  • 5 Replies
  • Colin Braley

    September 7, 2006 at 7:47 pm

    So what you are saying is that you want to be able to set up a project where you can replace the footage, move it around in 3d space, and the camera automatically moves through 3d space looking at each layer? I made a project a couple months back where I had a 3d camera set up that would automatically move around the comp at a constant speed and look at each layer in order from top to bottom. The project is AE 7 but the expressions would work in 5.5 if you changed some of the vector math stuff to the old syntax. If you want me to try to dig up the project post a message.
    ~Colin

  • Mike Clasby

    September 7, 2006 at 10:02 pm

    I think you can do what you want with Dan’s comp “pan,tilt,focus&zoom” at the end of his tut, “Building the World’s Greatest Cameraman”, using After Effects 5.5’s Expression Controls, here:

    https://www.creativecow.net/show.php?page=/articles/ebberts_dan/expression_cont/index.html

    or click his head and scroll down.

    That comp is based on 4 layers moving randomly in 3D space (the unruly, Dan, evol, James and Larry) and works a charm, so stationary layers you set up in 3D space should be no problem.

    Which layer is focused on is controlled by keyframes (slider Control) on a Null referencing their order in the stack, hold time depends on the space between keyframes.

    Pan Time (time to move to next layer) is the first line in the expression for the Camera’s POI, here’s the line:

    pan_time = .5;

    This is for 1/2 second, but you could tie that to a slider to change easily.

    Maybe this will help.

    And if by grid you mean a video Wall type of grid, this earlier post from Dan might help. The layers Colin want to arrange are 360×240, so adjust as needed:

    Dan Ebberts – 11:14pm Jan 10, 05 PST (#1 of 2)
    Colin,
    Try this:

    horizSpace = 360;

    vertSpace = 240;

    numCol = 10;

    origin = [horizSpace/2,vertSpace/2,0];

    col = (index – 1)%numCol

    row = Math.floor((index – 1)/numCol);

    origin + [col*horizSpace, row*vertSpace, 0]

    Dan

    Or, this one from Dan (lost specific reference), for position to make a grid out of layer order (adjust number of rows and columns to you needs):

    numRows = 10;
    numCols = 10;

    row = Math.floor((index – 1)/numCols);
    col = (index – 1)%numCols;
    x = col*width + width/2;
    y = row*height + height/2;
    xOffset = (this_comp.width – numCols*width)/2;
    yOffset = (this_comp.height – numRows*height)/2;

    [x,y] + [xOffset,yOffset]

  • Julian Sixx

    September 8, 2006 at 3:48 am

    Hi
    [Colin Braley] “If you want me to try to dig up the project post a message.”

    I’d like to see your project if you don’t mind 🙂

  • Patrick Hearn

    September 8, 2006 at 8:10 am

    Hi,
    Yeah, Colin, that’s exactly what I’m trying to make. I’m going to try out what yikesmikes suggested but I would be more than interested to see how you did your project.
    Cheers for the help guys!

  • Colin Braley

    September 8, 2006 at 7:32 pm

    Hey,
    I just looked for the project and since its somthing I did for my old employer I don’t seem to have the finished project, however I do have a semi-done version of the project I brought home… I’ll fix it up and post it sometime around Monday…

    ~Colin

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy