Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Keep distance between layers when scaling middle layer.

Community Beginner ,
Jun 08, 2022 Jun 08, 2022

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
231
Translate
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
Participant ,
Jun 08, 2022 Jun 08, 2022

multiply by a negative value

Translate
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

Thanks for that. Multiply what by a negative value?

Translate
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
Participant ,
Jun 08, 2022 Jun 08, 2022

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

Translate
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
LATEST
Yes, ta.
Translate
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
LEGEND ,
Jun 08, 2022 Jun 08, 2022

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

Translate
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

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

Translate
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