Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Reduce scale on Layer A, and increase scale on Layer B

  • Reduce scale on Layer A, and increase scale on Layer B

    Posted by Alex Barratt on June 11, 2020 at 11:34 am

    Hey all,

    This simple thing became a bit more complicated I first thought..

    How do I get my scale size to decrease on one layer, but at the same time increase the size on another layer?

    I.e.
    Layer A changes from 100% to 50% scale.
    Layer B changes from 100% to 200% scale.

    Thanks!

    Alex T. Barratt
    Multimedia Designer

    Alex Barratt replied 5 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Robert Müller

    June 11, 2020 at 12:56 pm

    Hi Alex,
    this should do what you are looking for. It feels like there should be a more elegant way but I cant think of one atm:
    sFact=thisComp.layer("layer_1").transform.scale[0]/100;
    if(sFact == 0){
    sFact = 0.0000001
    }
    s=transform.scale[0]/sFact;
    [s,s]

    It basicaly gets the scaling factor from the first layer and divides its scale by the factor, hence negating it. So if your layer scales up to eg 200 (scale factor 2) the other value gets devided by this, so it goes down to 50.
    Note that the layer with the expression could never truly reach 0, only get very small. I added the if loop for the case your first layer reaches zero and the expression wont break for dividing by zero, so I inserted a very small number.

  • Alex Barratt

    June 12, 2020 at 1:56 pm

    Thanks Robert! That’s what I was looking for.

    Alex T. Barratt
    Multimedia Designer

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