FORUMS: list search recent posts

Expression writing

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Gina Sarentino
Expression writing
on Apr 29, 2017 at 1:28:21 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 ]



Return to posts index

Steve Sierra
Re: Expression writing
on Apr 29, 2017 at 4:18:36 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 !


Return to posts index

Gina Sarentino
Re: Expression writing
on Apr 29, 2017 at 5:32:34 pm

This makes sense, thank you so much!


Return to posts index

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