FORUMS: list search recent posts

Position slider expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Morgan Williams
Position slider expression
on Sep 25, 2013 at 1:35:56 pm

Hi all,
New to expressions and this forum, but old to AE. ; )

I'm looking for a code for the position property that would allow a slider with a 0-100 range to drive that property so that:

0 = value x
50 = value y
100 = value z

and x, y and z do not have to be necessarily sequential.

Any thoughts?
Much appreciated!
M


Return to posts index

Morgan Williams
Re: Position slider expression
on Sep 25, 2013 at 2:30:55 pm

BTW, I'm using split position properties so these only need to be single number values...


Return to posts index

Darby Edelen
Re: Position slider expression
on Sep 25, 2013 at 9:33:31 pm

Do you need the return value to change as the input ranges from 0 to 50 and 50 to 100 or do you want them to snap as the input value reaches each threshold?

Darby Edelen


Return to posts index


Morgan Williams
Re: Position slider expression
on Sep 25, 2013 at 9:42:33 pm

I need the value to change.


Return to posts index

Morgan Williams
Re: Position slider expression
on Sep 25, 2013 at 10:19:22 pm

Sorry that was sort of an incomplete sentence, I need the return values to change as the slider moves between the 0, 50, 100 inputs.
Thx


Return to posts index

Darby Edelen
Re: Position slider expression
on Sep 25, 2013 at 11:57:34 pm

Something like this applied to the position property should work.

slider = effect("Slider Control")(1);
x = [300, 600];
y = [500, 300];
z = [800, 700];

if(slider < 50) linear(slider, 0, 50, x, y);
else linear(slider, 50, 100, y, z);


Darby Edelen


Return to posts index


Morgan Williams
Re: Position slider expression
on Sep 26, 2013 at 12:30:29 pm

That works great! Thank you so much.

I'm working on what I hope will be a really fun and fancy character rig. I'll post a link to the file when/if I finish it successfully so you can see how I used the code. I plan the share the rig with my students and anyone else interested.

If you don't mind I'll include a little note of acknowledgment crediting you with help on the coding. I for sure couldn't have figured that one out on my own.

Again, many thanks!

M


Return to posts index

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