FORUMS: list search recent posts

Wiggle, but never go past set minimum.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Navarro Parker
Wiggle, but never go past set minimum.
on Jun 26, 2014 at 5:28:45 pm
Last Edited By Navarro Parker on Jun 26, 2014 at 5:29:39 pm

I put a wiggle on a Shape Layer's Trim Path End parameter that's at 50%. I only want to wiggle values greater than 50 (I never want it to go below 50).

I tried this:
n=wiggle(1,10);
value + n

But it always gives me 100%. What am I doing wrong?


Return to posts index

Dan Ebberts
Re: Wiggle, but never go past set minimum.
on Jun 26, 2014 at 5:35:44 pm

You could try something like this:

amp = 5;
w = wiggle(1,amp) - value;
value + amp + w


Dan



Return to posts index


Dan Ebberts
Re: Wiggle, but never go past set minimum.
on Jun 26, 2014 at 6:18:22 pm

I didn't need to make it so complicated. This does the same thing:

amp = 5;
wiggle(1,amp) + amp;


Dan



Return to posts index


Navarro Parker
Re: Wiggle, but never go past set minimum.
on Jun 26, 2014 at 6:44:36 pm

Fantastic!

Similarly, how can I tell a wiggle to stay between a min and max value?

Traditionally, if I want to wiggle between 50~75%, I'd set the starting value at the midpoint (75-50)÷2+50 then set the amp value to (75-50)÷2. Math!

It would be handy to directly set min and max values, but have the normal controls over wiggle (freq,amp,octave,seed). This is of course for 1-dimensional parameters like rotation and sliders.


Return to posts index


Kevin Camp
Re: Wiggle, but never go past set minimum.
on Jun 26, 2014 at 11:06:32 pm

that's pretty much how you'd do it... you could simplify the math a bit, like this:

min=50;
max=75;
freq=5;
oct=5;
min+Math.abs(wiggle(freq,max-min,oct))


Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Navarro Parker
Re: Wiggle, but never go past set minimum.
on Jun 27, 2014 at 1:31:21 am

This doesn't seem to be working correctly on a Shape Layer's Trim Paths which goes from 0~100%.

Your expression pegs the parameter at 100%. It never goes under.

I removed the first 'min' from last line and just used this which got me closer:
Math.abs(wiggle(freq,max-min,oct))

I set it to wiggle between 54~71, but I'm getting values near 78%.


Return to posts index


Kevin Camp
Re: Wiggle, but never go past set minimum.
on Jun 27, 2014 at 7:53:42 pm

trim paths probably needs to be set to 0... wiggle still uses the value of the property.

i'll take a look when i get a chance.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Kevin Camp
Re: Wiggle, but never go past set minimum.
on Jun 27, 2014 at 7:58:46 pm

i'm rendering right now, but if you can, you might try changing the last line to this:

min+Math.abs(wiggle(freq,max-min,oct))-value

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Kevin Camp
Re: Wiggle, but never go past set minimum.
on Jun 27, 2014 at 8:26:50 pm

nope, that won't work... i think about it a bit more, but i don't think we can get around having to set the base value to 0.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index



Dan Ebberts
Re: Wiggle, but never go past set minimum.
on Jun 27, 2014 at 8:39:38 pm

You can do it by having the wiggle reference a property that doesn't get clipped (like rotation):

min = 25;
max = 75;
freq = 1;
amp = (max-min)/2;
w = rotation.wiggle(freq,amp)-rotation;
(min+max)/2 + w


Dan



Return to posts index

Navarro Parker
Re: Wiggle, but never go past set minimum.
on Jul 14, 2014 at 11:45:09 pm

I'm trying your expression to make an object only scale in one axis. But I'm getting "Class number has no property named 0" error

min = 25;
max = 75;
freq = 1;
amp = (max-min)/2;
w = rotation.wiggle(freq,amp)-rotation;
[(min+max)/2 + w[0],value[1]];


Return to posts index


Dan Ebberts
Re: Wiggle, but never go past set minimum.
on Jul 14, 2014 at 11:48:56 pm

Try changing the last line to this:

[(min+max)/2 + w,value[1]];

Dan



Return to posts index

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