Skip to main content
Participant
July 9, 2018
Answered

Newbie expression shape size to slider

  • July 9, 2018
  • 1 reply
  • 7831 views

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

    This topic has been closed for replies.
    Correct answer foughtthelaw

    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]

    1 reply

    foughtthelaw
    foughtthelawCorrect answer
    Inspiring
    July 9, 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]

    Participant
    July 9, 2018

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

    Thanks a lot!