Quantcast
Channel: Adobe Community : Popular Discussions - After Effects Expressions
Viewing all articles
Browse latest Browse all 47983

Who else would find a global Expressions object useful?

$
0
0

I often find myself working with multiple layers which all have the same set of expressions applied - eg, one for position, one for rotation, etc. Sometimes there might be one expression that I have to paste between layers in multiple different comps, and then if I need to add extra functions to that expression I've got to copy and paste it on all the layers again. What would be useful is a global "Expressions" object - basically a panel where you could define functions, then refer to them from anywhere:

 

[in the Expressions panel]

function calculatePosition(p, i, dx) {  // p is the object's current position, i is its index, dx is x-spacing  x = p[0] + (i * dx);  y = p[1];  return [x, y];}

 

[in a layer's Position property]

Expressions.calculatePosition(transform.position, index, 200)

 

Then if you decide you want to space things, say, vertically rather than horizontally, you just need to change one thing.

 

I've submitted this as a feature request, but I don't know if it'd be useful to anyone else - it's not in the list of possible upcoming features as far as I know.


Viewing all articles
Browse latest Browse all 47983

Trending Articles