Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions 2d logarithmic scale controller

  • 2d logarithmic scale controller

    Posted by Bill Porter on March 9, 2010 at 1:12 pm

    I’m trying to recreate a camera move in 2d which tracks straight in, and with a slight vetical position change.

    Effectively there is just a foreground object and a background layer (made up of lots of massive raw image sequences, so I’m reluctant to use a 3d camera.)

    Does anyone know a cunning method with expressions I can use so that the foreground object scale and position get exponentially greater in realtion to the background scale, or vice versa?

    If I parent the backround layers to a null A, the foreground object to null B, and control them both somehow with null C?

    I tried looking around in other posts but my knowledge is such that I’m not sure what I’m looking for, or how I’d implement it. Would it be simpler for me to just go brave with 3d layers?

    Any suggestions would be warmly recieved

    B

    Bill Porter replied 16 years, 4 months ago 2 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    March 9, 2010 at 4:18 pm

    I think you can do it with an expression like this for each object’s scale:

    startDist = 500;
    cameraMove = thisComp.layer(“Null 1”).effect(“Slider Control”)(“Slider”);

    value*(startDist/(startDist – cameraMove))

    The startDist variable defines the object’s initial distance from the “camera”. I used 500 for the foreground object and 1000 for the background object. A slider attached to a null defines how much the camera has moved: positive values are into the scene, negative values are away from the scene (I just set my slider up to have a range of -1000 to + 1000). Of course you have to make sure the camera never gets to one of the objects or that object’s expression will break.

    Dan

  • Bill Porter

    March 9, 2010 at 5:35 pm

    YESS!!! That is genius, and works perfectly.

    This is a naive stab in the dark, but for the position movement would I add something this?


    startPosition = 50;
    cameraMove = thisComp.layer("Null 1").effect("Slider Control 2")("Slider");

    value*(startPosition/(startPosition - cameraMove))

    Many thanks

  • Dan Ebberts

    March 9, 2010 at 6:00 pm

    I guess I’m not sure what you’re trying to do exactly. Did you want to simulate moving the foreground relative to the background rather than (or in addition to) moving the camera?

    Dan

  • Bill Porter

    March 9, 2010 at 6:22 pm

    In addition. I used your scaling expressions, which simulates a camera tracking just how I hoped, but I also want the camera to track slighgtly in the Y axis too, and giving the same kind of paralax.

    Bill

  • Dan Ebberts

    March 9, 2010 at 8:43 pm

    I’m not sure this is exactly right, but I think it would be something like this:

    startDist = 500;
    nominal = 500;
    cameraMove = thisComp.layer(“Null 1”).effect(“Camera Z offset”)(“Slider”);
    newDist = startDist – cameraMove;
    xOffset = thisComp.layer(“Null 1”).effect(“Camera X offset”)(“Slider”);
    yOffset = thisComp.layer(“Null 1”).effect(“Camera Y offset”)(“Slider”);

    value + [xOffset,yOffset]*(nominal/newDist)

    You’d add two new sliders to the null for camera x and y offset. The new “nominal” variable would be set to the same value for all objects (or hook it to a slider as well). Oh, and I renamed the original slider to “Camera Z offset”.

    Dan

  • Bill Porter

    March 10, 2010 at 11:19 am

    It works like a dream. I think I set it up right, but I set the foreground and background nominal’s to different values to get the paralax.
    Amazing, thank you so much Dan!

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