-
Random Initial Scale plus wiggle scale
Apologies if this has been covered elsewhere, I searched the threads but couldn’t find a good match.
I’ve made a setup to randomise the scale of a layer and also apply an animatable wiggle to it. I’ve linked it to sliders which control frequency, amount, amount multiplier and random seed. It works…but not as intended.
You’ll see in the script below that the intention was to have a random start scale clamped between 25 and 100%, and then apply wiggle to it.s= comp(“AutoSparkle”).layer(“Control”).effect(“SEED”)(“Slider”);
seedRandom(index*s, true);
r= random(25,100);
f= comp(“AutoSparkle”).layer(“Control”).effect(“FREQ”)(“Slider”);
m= comp(“AutoSparkle”).layer(“Control”).effect(“AMOUNT MULTIPLIER”)(“Slider”);
a= comp(“AutoSparkle”).layer(“Control”).effect(“AMOUNT”)(“Slider”)*m;
clamp (a,5,300);
w= wiggle(f,a);
[r+w[0],r+w[0]]So I would expect that with the Amount slider at 0, the layer size would
be between 25 or 100. But somehow I am getting initial scales over 100%
and I am not sure why. I think it’s something to do with the scale array because [r,r] works for the initial random scale on it’s own, but the wiggle needs to be [w[0],w[0]] I don’t understand it well enough to figure it out though. I’d be grateful if anyone can tell me where
I’ve gone wrong.Thanks!