ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Wiggle expression on scale, but only make smaller

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dustin WilsonWiggle expression on scale, but only make smaller
by on Jul 21, 2015 at 2:34:45 pm

I'm working on a project and need to have multiple layers wiggle the scale uniformly, but only make them smaller, and not larger.

I have all the layers using a slider control to animate the effect on and off, but I can't figure out a way to restrict the wiggle to make them smaller only.

Can anyone lend a hand?

Here's the current expression if it makes any difference (I have a couple different layers for expressions, hence the names :) hopefully that doesn't make it more confusing):

w = wiggle(thisComp.layer("frequency").effect("Slider Control 2")("Slider"),thisComp.layer("amounts").effect("Slider Control 2")("Slider"));
[w[0],w[0]]

Thanks!


Return to posts index

Kevin CampRe: Wiggle expression on scale, but only make smaller
by on Jul 21, 2015 at 3:38:02 pm

you could just subtract the wiggle from the scale value...

try changing w to something like this:
w = value[0] - Math.abs(wiggle(thisComp.layer("frequency").effect("Slider Control 2")("Slider"),thisComp.layer("amounts").effect("Slider Control 2")("Slider"))[0]);
[w, w]


Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Dustin WilsonRe: Wiggle expression on scale, but only make smaller
by on Jul 21, 2015 at 3:53:37 pm

Thanks for taking the time to look into this.

I tried your solution, but it didn't seem to make a difference. They are still getting larger... Am I missing something?


Return to posts index


Kevin CampRe: Wiggle expression on scale, but only make smaller
by on Jul 21, 2015 at 5:04:27 pm

we needed to remove the base value from the wiggled value, then subtract it... this seems to work:

freq = 5;
amount = 35;
w = wiggle(freq, amount);
s = scale[0] - Math.abs(w[0] - scale[0]);
[s, s]


just link your sliders to the corresponding variables.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Dustin WilsonRe: Wiggle expression on scale, but only make smaller
by on Jul 21, 2015 at 7:42:38 pm

Kevin, again, I really appreciate you taking the time.

I started a new comp and just dropped in your expression to see if it was the slider causing the problem, but I'm still not getting the result I'm looking for (object doesn't enlarge, only shrinks).

This seems like it would work, from what you've shown, but it still isn't working for me. If it's working for you, would you mind linking me a file that it's working in?

Sorry for the trouble!


Return to posts index

Kevin CampRe: Wiggle expression on scale, but only make smaller
by on Jul 21, 2015 at 10:07:41 pm

i may be missing what you're after, but here's a file with a solid that has that wiggle expression that makes the scale only change to a smaller value:

9065_wigglenegonly.aep.zip

i added a transparent red square of the same size (w/o the expression) to show that the wiggle scale never exceeds that size.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index


Dustin WilsonRe: Wiggle expression on scale, but only make smaller
by on Jul 22, 2015 at 2:37:17 pm

Ok. I'm an idiot. I apologize. This has been working all along, but I apparently had only copied the expression to one of my layers, not all of them.

Sorry for making you put forth even more effort than you needed to! And thanks again for all your help! It is very much appreciated!


Return to posts index

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