Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects experssion?

  • experssion?

    Posted by Accountclosedduetonorealnameused on August 6, 2007 at 8:11 pm

    is this possible with an expression…

    I need a layer (layer B) to follow in position another layers (layer A) right edge.

    So when Layer A is scaled, Layer B moves in space to follow the right edge of layer A. The same would go for when Layer A is rotated or repostioned, Layer B would stay snapped to layer A’s right edge.

    I can not use parenting here, because I do not want the layer B to be scaled by layer A, only re-po’d.

    this make sense?
    basically I am creating a rainbow ribbon in many segments that I need to accordion, and want to stretch certain sections longer than others, while maintaining the connections. The thickness (height) of the ribbon can not change.

    Kevin Camp replied 18 years, 9 months ago 3 Members · 3 Replies
  • 3 Replies
  • Kevin Camp

    August 6, 2007 at 9:10 pm

    i’m sure ther is a much more elegant way to write this…. but using the pickwhip, i was able to create this expression:

    x = thisComp.layer(“Layer A”).transform.position[0] + ((width + ((thisComp.layer(“Layer A”).width) * (thisComp.layer(“Layer A”).transform.scale[0])/100))/2);

    y = transform.position[1];

    [x,y]

    like i said, its ugly, but works…

    Kevin Camp
    Designer – KCPQ, KMYQ & KRCW

  • Lord Scales

    August 6, 2007 at 11:46 pm

    Nice expression. It worked fine for me…

  • Kevin Camp

    August 7, 2007 at 8:24 pm

    ok, i had some time today…

    here is a version that will look at the layer below it, so it can be pasted into one layer and then duplicated… each duiplicate’s x position will then be based on the layer below it….

    L = thisComp.layer(index + 1);
    x = L.transform.position[0] + (((width * (transform.scale[0] / 100)) + ((L.width) * (L.transform.scale[0]) / 100)) / 2);
    y = transform.position[1];

    [x,y]

    Kevin Camp
    Designer – KCPQ, KMYQ & KRCW

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