Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Linking positions

  • Posted by Marten Kopp on January 9, 2009 at 11:34 pm

    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..

    Dan Ebberts replied 17 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    January 10, 2009 at 12:46 am

    Something like this is probably closer to what you’re looking for:

    columns = 3;

    row = Math.floor((index-1)/columns);
    col = (index-1)%columns;
    x = width/2 + col*width;
    y = height/2 + row*height;
    [x,y,value[2]]

    Dan

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