ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Parent Y-scale to a slider

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
S.J. DeLuise
Parent Y-scale to a slider
on Mar 30, 2011 at 1:25:21 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.


Return to posts index

Dan Ebberts
Re: Parent Y-scale to a slider
on Mar 30, 2011 at 1:36:47 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



Return to posts index

S.J. DeLuise
Re: Parent Y-scale to a slider
on Mar 30, 2011 at 1:39:53 am

Yup, that worked.
Thanks!

People say my motion graphics are moving.


Return to posts index


S.J. DeLuise
Re: Parent Y-scale to a slider
on Mar 30, 2011 at 1:44:10 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.


Return to posts index

Dan Ebberts
Re: Parent Y-scale to a slider
on Mar 30, 2011 at 2:33:09 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



Return to posts index

S.J. DeLuise
Re: Parent Y-scale to a slider
on Mar 30, 2011 at 3:12:53 am

Worked great!
Thanks again, Dan.

People say my motion graphics are moving.


Return to posts index


Robert Roebke
Re: Parent Y-scale to a slider
on Mar 21, 2017 at 4:00:55 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


Return to posts index

Dan Ebberts
Re: Parent Y-scale to a slider
on Mar 21, 2017 at 5:07:18 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



Return to posts index

Robert Roebke
Re: Parent Y-scale to a slider
on Mar 22, 2017 at 1:48:25 pm

Thank you very much!

One more question - how could i define the anchor point / postion from where it should scale...? 😳


Return to posts index


Dan Ebberts
Re: Parent Y-scale to a slider
on Mar 22, 2017 at 5:40:22 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



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]