Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions x and y values does not match after applying an expression which shouldn’t alter them

  • x and y values does not match after applying an expression which shouldn’t alter them

    Posted by David Cabestany on March 14, 2012 at 9:42 pm

    I’m using the expression below to control de scale of a bunch of layers that are going to be sequenced, each layer has its in point two seconds after the previous one, the layer that they are referencing (my index+1) it’s just a null with keyframed scale from 100 to 148% over 10 seconds. The layers are already scaled at 100% so I don’t want them to get too big and pixelated, due to the sequencing I’m using a valueAtTime command in order to have them start later in time, but when I put the last value (to subtract it from the scale and prevent them to be too scaled up, it removes it on the x axis but not on the y, so the image becomes distorted. The original null controlling the scale is not distorted so I really can’t understand why is getting distorted here.

    Can anyone tell me what I’m doing wrong?
    Thanks!

    sizemaster = thisComp.layer(index+1).transform.scale.valueAtTime(time+1);
    sizemaster-44;

    David Cabestany replied 14 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 14, 2012 at 10:26 pm

    Scale (for a 2D layer) is a 2-element array, and you’re only subtracting 44 from the x value. Try it this way.

    sizemaster = thisComp.layer(index+1).transform.scale.valueAtTime(time+1); sizemaster-[44,44];

  • David Cabestany

    March 15, 2012 at 2:50 pm

    Thanks a lot Dan, I ended up using a slightly different approach, but added up to the same. Your is a lot cleaner and concise.

    Thanks again!

    sizemasterx = thisComp.layer("opacity and scale ctrl").transform.scale[0]
    sizemastery = thisComp.layer("opacity and scale ctrl").transform.scale[1];

    [(sizemasterx-40),(sizemastery-40)]

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