Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Scale Linked to X and Y sliders at the same time?

  • Scale Linked to X and Y sliders at the same time?

    Posted by Ian Thomson on October 16, 2008 at 9:16 pm
    temp=effect("Separate XYZ Position") ("X Position")+100;
    
    if(temp<0) temp *= -1;
    
    [temp,temp,temp]

    Hello again!

    I got some excellent help for linking a layer Scale property to a slider and keeping the results positive, https://forums.creativecow.net/readpost/227/11350

    Now my more complicated question is this; is it possible to link scale to separate sliders (X position) and (Y position) and both have them affect the scale equally?

    Basically what we’re trying to do is Pan footage (X/Y) and have it automatically scale/crop to fit the comp. Some clips require panning X, some Y, Some both.

    Is it possible to link scale to 2 different values? Or is there a better way to go about this sort of thing?

    Any help here Highly appreciated!!!
    Thanks,
    -Ian

    Brendan Mccullough replied 17 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Brendan Mccullough

    October 16, 2008 at 11:44 pm
    x=effect("Separate XYZ Position") ("X Position")+100;
    y=effect("Separate XYZ Position") ("Y Position")+100;
    if(x<0) x *= -1;
    if(y<0) y *= -1;
    if(x>y) [x,x];
    else [y,y];
    

    You can’t have it link to two values at the same time, but what if it was selective? This example only uses the greater of the two values…

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