Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression illiterate. Please help me with this basic expression:

  • Expression illiterate. Please help me with this basic expression:

    Posted by Jeremy Garchow on May 3, 2007 at 8:06 pm

    I am key framing two layers of text for position, I need the bottom text layer to be the exact same position as the one on top, except the the x value needs a value of 4 added to it (to move the bottom layer 4 pixels to the right of the top layer).

    Does this make sense? I can’t figure out the expression language and key framing them all is cool but annoying, and this seems like a perfect time to learn a simple expression to train my expression feeble mind. Thanks a lot in advance.

    Jeremy

    Jeremy Garchow replied 19 years ago 3 Members · 5 Replies
  • 5 Replies
  • Lord Scales

    May 3, 2007 at 9:11 pm

    x = thisComp.layer(“name”).transform.position[0]+4;
    y = thisComp.layer(“name”).transform.position[1];

    [x, y]

    Lord Scales

  • Jeremy Garchow

    May 3, 2007 at 9:51 pm

    You are and king/queen among men/women.

    I take that back, you are a lord of scales.

    Thanks!

    Jeremy

  • Filip Vandueren

    May 4, 2007 at 1:19 am

    In Motionscript, you can add two vectors simply together like this:

    [10,10] + [2,4] => [12,14]

    since the position contains a vector, the expression can be as simple as:


    thisComp.layer(“name”).transform.position + [4,0];

    (this used to not always be the case – 5.5 ? -there was a function called Add or vectorAdd, or something like that)

  • Lord Scales

    May 4, 2007 at 1:30 am

    Nice info, Filip! I guess this function was addVector(?).

    I really like the variables. Even this being a simple expression, I have to simplificate it. Since I started to study Dan Ebberts’ Motion Script.com, I started creating variables to everything.
    They are really useful and the best is that we can add a lot of names to them and it is easy to memorize.

    Lord Scales

  • Jeremy Garchow

    May 4, 2007 at 3:09 am

    If the text layer is 3D, it’s as simple as adding a z vector, no?

    thisComp.layer(“name”).transform.position + [4,0,0];

    Thanks again. Extremely helpful.

    Jeremy

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