Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Parent Y-scale to a slider

  • Parent Y-scale to a slider

    Posted by S.j. Deluise on March 30, 2011 at 1:25 am

    I’m trying to use this expression to parent only the y-scale of a layer to a slider.

    But I’m getting this:
    “Bad argument: index 1 out of range for stream of dimension 1, Expression disabled.”

    It works fine for x-only when I change it to this:
    [temp[0], value[1]];

    Why?

    temp = thisComp.layer("Null 3").effect("Slider Control")("Slider");
    [value[0], temp[1]];

    People say my motion graphics are moving.

    Dan Ebberts replied 9 years, 1 month ago 3 Members · 9 Replies
  • 9 Replies
  • Dan Ebberts

    March 30, 2011 at 1:36 am

    You’re trying to extract a second dimension from a value that only has one (the slider). Try it this way:

    temp = thisComp.layer(“Null 3”).effect(“Slider Control”)(“Slider”);
    [value[0], temp];

    Dan

  • S.j. Deluise

    March 30, 2011 at 1:39 am

    Yup, that worked.
    Thanks!

    People say my motion graphics are moving.

  • S.j. Deluise

    March 30, 2011 at 1:44 am

    Actually I thought that was the whole issue, but now I’m hitting another snag when I try to use an audio-to-keyframes layer to control the value of Y-scale.

    error: “Expression result must be of dimension 2, not 1”

    a = thisComp.layer("audio").effect("Both Channels")("Slider");
    [value[0], a];

    linear(a, 0, 12, 100, 112);

    People say my motion graphics are moving.

  • Dan Ebberts

    March 30, 2011 at 2:33 am

    I think this is what you want:

    a = thisComp.layer(“audio”).effect(“Both Channels”)(“Slider”);
    y = linear(a, 0, 12, 100, 112);
    [value[0], y];

    Dan

  • S.j. Deluise

    March 30, 2011 at 3:12 am

    Worked great!
    Thanks again, Dan.

    People say my motion graphics are moving.

  • Robert Røbke

    March 21, 2017 at 4:00 pm

    Hey Dan,

    what if i want to Parent X-Scale AND Y-Scale to a different Slider? I couldn’t figure it out.
    Would be great to hear from you!

    Thanks in advance,

    Rob

  • Dan Ebberts

    March 21, 2017 at 5:07 pm

    Something like this should work:

    x = thisComp.layer(“Your Layer”).effect(“Slider Control X”)(“Slider”);
    y = thisComp.layer(“Your Layer”).effect(“Slider Control Y”)(“Slider”);
    [x,y]

    Dan

  • Robert Røbke

    March 22, 2017 at 1:48 pm

    Thank you very much!

    One more question – how could i define the anchor point / postion from where it should scale…? ????

  • Dan Ebberts

    March 22, 2017 at 5:40 pm

    You’d need an expression for the Anchor Point (and possibly a compensating Position expression, if you don’t want the layer to move when you change the Anchor Point).

    Dan

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