Copy link to clipboard
Copied
Hi, have three layres equidistant in y. Would like to scale the middle layer and have it 'push' the top layer up, bottom layer down but maintain the distance 'border' between them all.
Have got as far as - thisComp.layer("Null 1").transform.scale[0] - but this only creates a downward movement - can move up but only if I scale below 0 which of course I don't want.
Can anyone tell me how I'd go about making a positive scale factor push the top layer up?
Or if anyone knows how to sort this scale/boreder thing.
I basically have no idea what I'm doing so any help gratefully recieved.
Thanks.
Copy link to clipboard
Copied
multiply by a negative value
Copy link to clipboard
Copied
Thanks for that. Multiply what by a negative value?
Copy link to clipboard
Copied
thisComp.layer("Null 1").transform.scale[0]*-.6+500
change the 500 to whatever, and this is if the anchor point is centered, hope that helps. but did you want the other layer to always stay at 100% - I assume yes
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You multiply the position value by -1 to move in the opposite direction or simply subtract it instead of adding. The rest is a simple case of interpolating the driver value to the position value. Example:
mScaleY=thisComp.layer("XYZ").transform.scale[1];
mPosX=value[0];
mPosY=value[1];
X=mPosX;
Y=linear(mScaleY,100,500,mPosY, mPosY+500);
[X,Y]
Change the values as needed to accomodate for your actual layer sizes and placement and apply it to the position property. Of course this could be fancied up in a million ways, but that would require more precise info about how you want it to work, what your actual values are and so on.
Mylenium
Copy link to clipboard
Copied
Thanks. New to this expressions lark so will work through this.