-
Linking positions
Hi,
I am kind of new to after effects expressions. I am building a comp with a bunch of clips. The result should be like a video wall. But I would like to make it easy update-able. So I started figuring out the use of expressions and came up with this:
x = thisComp.layer(thisLayer, -1).transform.position[0] + 800;
y = thisComp.layer(thisLayer, -1).transform.position[1] + 0;
z = thisComp.layer(thisLayer, -1).transform.position[2] + 0;if ( x >2000) {
x = thisComp.layer(thisLayer, -1).transform.position[0] – 1600;
y = thisComp.layer(thisLayer, -3).transform.position[1] + 650;
}else{
x = thisComp.layer(thisLayer, -1).transform.position[0] + 800;
y = thisComp.layer(thisLayer, -1).transform.position[1] + 0;
z = thisComp.layer(thisLayer, -1).transform.position[2] + 0;
}[x,y,z]
I have the feeling I am in the right direction, cause is lines up the clips in rows of 3. After every thirth video it put’s the 4th on the next row. But disaster strikes when I start to move my first layer.
Is there a way to replace the:
if ( x >2000) {
with something that would be like:
If the x is bigger then the x of thisLayer -3 + 2400 then…
Cause it seems the expresion is mixing up the x of the workarea with the x of the first layer.
Since I am asking this question, I could also ask another. Just a simple one. I found out you can easily lock positions with other layers. Or just link to there transformation options.
Is it possible to link the expression of one layer to another? A more easy way then copying the same expression into all the layers?
Any help is welcome..