Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Scale of one layer to position of another?

  • Scale of one layer to position of another?

    Posted by Trevor Gilchrist on January 27, 2011 at 7:42 pm

    I know, I know… I should have this down by now, but my math skills are wimpy…

    I have a nested, 2D Comp A which scales 200% on the -Y (its anchor is at its top left corner)

    I have a nested Comp B which I would to have move down on the Y by the correct number of pixels to accommodate Comp A’s downward expansion.

    But I can’t do the math.

    To rephrase: as comp A gets deeper, I want Comp B to get out of the way.

    Please help an algebra-less fool..

    Many thanks.

    Trevor Gilchrist replied 15 years, 8 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    January 27, 2011 at 8:52 pm

    Something like this, probably:

    L = thisComp.layer(“Comp A”);

    value + [0,(L.scale[1]-100)*(L.height-L.anchorPoint[1])/100];

    Dan

  • Trevor Gilchrist

    January 27, 2011 at 9:42 pm

    Mr Ebberts.

    You must live and breathe the logic of this… Wish I had those skills.
    I am humbled by your rapid — and 100% successful — solution.

    Thank you.

  • Trevor Gilchrist

    January 27, 2011 at 9:49 pm

    …and here is the expression itself, for those (like me) who want to see these things through to the conclusion…

    Where “Scaled” is the name of the layer that is becoming deeper in the Y axis.
    The expression is applied to the Position value of the layer that’s getting out of its way.

    I love math. I just don’t understand it.

    Thanks again Dan.

    value + [0,(thisComp.layer("Scaled").scale[1]-100)*(thisComp.layer("Scaled").height-thisComp.layer("Scaled").anchorPoint[1])/100];

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