Keep distance between layers when scaling middle layer.

New Here ,
Jun 08, 2022 Jun 08, 2022

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.

TOPICS
Expressions

Views

32

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

multiply by a negative value

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

Thanks for that. Multiply what by a negative value?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 08, 2022 Jun 08, 2022

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

LATEST
Yes, ta.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 08, 2022 Jun 08, 2022

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

Thanks. New to this expressions lark so will work through this.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines