Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions 2 sliders that change height and width on 1 layer?

  • 2 sliders that change height and width on 1 layer?

    Posted by Rob Moffett on October 20, 2007 at 6:53 am

    I have an object, and two sliders.

    Im trying to get this working so one slider alters the width of the object with its value, and the other alters the height.

    Ok, so, it works when i want to use just the one slider,

    height = thisComp.layer(“slider1”).effect(“Both Channels”)(“Slider”);
    value+[0, height]

    But when i try add in the second slider, it stops working, and blows the image out huge.

    height = thisComp.layer(“slider1”).effect(“Both Channels”)(“Slider”);
    width = thisComp.layer(“slider2”).effect(“Both Channels”)(“Slider”);
    value+[width, height]

    Can anyone spot what i’m doing wrong?
    Im pretty new to expressions, so its probably the whole thing thats wrong. :S

    Any help would be great!

    Dan Ebberts replied 18 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    October 20, 2007 at 4:16 pm

    “height” and “width” are reserved words (use for the layer’s height and width), so try this instead:

    h = thisComp.layer(“slider1”).effect(“Both Channels”)(“Slider”);
    w = thisComp.layer(“slider2”).effect(“Both Channels”)(“Slider”);
    value+[w, h]

    I haven’t tested it, but it should work.

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy