Skip to main content
fredfx1957
Known Participant
August 16, 2017
Question

Limit value scale value using expression.

  • August 16, 2017
  • 1 reply
  • 5166 views

I'm using wiggle to scale a layer and I really only want it to wiggle  the scale in the positive direction (>100)
I looked into using an "if/else" statement, but AE always error-ed out.

This is what I'm using to wiggle the scale.

x=wiggle(effect("XTIME")("Slider"),effect("XDistance")("Slider"));

y=wiggle(effect("XTIME")("Slider"),effect("XDistance")("Slider"));

[x[0],y[0]]

I tried inserting this line of code, but it always error-ed

if (transform.scale[0] < 100) 100.2 else transform.scale[0]

Is it a syntax issue or am I just way off track. ANd I'm sure it's probably a really easy answer......

thanx in advance for your help

best,

Fred

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
August 16, 2017

This should work:

w=wiggle(effect("XTIME")("Slider"),effect("XDistance")("Slider"));

x = Math.max(w[0],100.2);

[x,x]

but it will give you flat spots (where it just sits at 100.2) when the wiggle value goes below 100.

Dan

fredfx1957
Known Participant
August 17, 2017

Wow. Cool,. A reply from the actual Dan Ebberts! Humbled and honored. (I look at your Tuts all the time)

So how do I have it wiggle just 100% and greater?

Thx again, and truly, I'm stoked that you answered my question personally!

best,

Fred

Mac Pro (2019) 3.2 GHz 16-Core Intel Xeon W 96 GB 2933 MHz DDR4 AMD Radeon Pro Vega II 32 GB
Dan Ebberts
Community Expert
Community Expert
August 17, 2017

Like this maybe:

w=wiggle(effect("XTIME")("Slider"),effect("XDistance")("Slider")/2)-value;

x = 100 + effect("XDistance")("Slider")/2 + w[0];

[x,x]

Dan