Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression writing

  • Expression writing

    Posted by Gina Sarentino on April 29, 2017 at 1:28 pm

    Hi everyone,

    Ive been studying expressions and have noticed that at the end of certain expressions there is [x,y] at the end of an expression.

    I want to know the significance of putting [x,y] or [xPosition,yPosition,zPosition] at the end?

    For example:
    var x = transform. position[0];
    var y = Math.sin(time);
    [x,y]

    Or

    var xPosition = transform.xRotation;
    var yPosition = transform.yRotation;
    var zPosition = transform.zRotation;
    [xPosition,yPosition,zPosition ]

    Gina Sarentino replied 9 years ago 2 Members · 2 Replies
  • 2 Replies
  • Steve Sierra

    April 29, 2017 at 4:18 pm

    Hi,

    In the first lines, you declare and give a value to your variables (that’s why you use “var” before, although it isn’t obligatory in expressions).

    Then, in the last line(s), you use these variables to assign a value to your property (position in your cases). The brackets are there to express a multi-value property (x,y or x,y,z for position / x,y,z rotation, etc…)
    Other properties (like 2d rotation) only take one value, so you don’t use the brackets.

    Hope this clarifies things a bit for you ????
    Cheers !

  • Gina Sarentino

    April 29, 2017 at 5:32 pm

    This makes sense, thank you so much!

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