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

Newbie expression shape size to slider

Community Beginner ,
Jul 09, 2018 Jul 09, 2018

Copy link to clipboard

Copied

Hi there,

I am a total newbie when it comes to expressions... I just can't understand the logic half the time (must read a book or something!)

Anyway I simply want to link the x and y size of my shape layer to sliders on a separate layer. In the current format one of these expressions....kinda works, then the second part overwrites it.

h = content("Rectangle 1").content("Rectangle Path 1").size[1];

[h, thisComp.layer("Size_Controller").effect("Size-Y")("Slider")]

w = content("Rectangle 1").content("Rectangle Path 1").size[0];

[w, thisComp.layer("Size_Controller").effect("Size-X")("Slider")]

Please advise,

Many Thanks,

Phil

Views

7.3K

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

correct answers 1 Correct answer

Engaged , Jul 09, 2018 Jul 09, 2018

The expressions output becomes your value for that property so if all you want is slider control you could do something like this on the size property:

x = thisComp.layer("Size_Controller").effect("Size-X")("Slider");

y = thisComp.layer("Size_Controller").effect("Size-Y")("Slider");

[x,y]

If you want to use the initial value of the rectangle size as a starting point and treat the sliders as offest values you would change the last line to:

value+[x,y]

Votes

Translate

Translate
Engaged ,
Jul 09, 2018 Jul 09, 2018

Copy link to clipboard

Copied

The expressions output becomes your value for that property so if all you want is slider control you could do something like this on the size property:

x = thisComp.layer("Size_Controller").effect("Size-X")("Slider");

y = thisComp.layer("Size_Controller").effect("Size-Y")("Slider");

[x,y]

If you want to use the initial value of the rectangle size as a starting point and treat the sliders as offest values you would change the last line to:

value+[x,y]

Votes

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 ,
Jul 09, 2018 Jul 09, 2018

Copy link to clipboard

Copied

LATEST

I knew it was meant to be very simple. Think I understand a little better now too!

Thanks a lot!

Votes

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