ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Irregular Wiggle Expression Between Different Compositions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kristian Matthews
Irregular Wiggle Expression Between Different Compositions
on Mar 6, 2018 at 11:05:43 am

I have a number of compositions, all very similar in size and content.

But the result of the expressions are wildly different, the first is the result I expected, but the subsequent ones are not.





I'm using seedRandom to prevent the motion from all being the same when I put them into another composition.

seedOffset = random(Math.min(thisComp.width, thisComp.height), Math.max(thisComp.width, thisComp.height));
seedRandom(seedOffset, true);

frequency = comp("Config").layer("Config").effect("Easter Egg & Star Position, Rotation & Scale Frequency")("Slider"); // 0.2
amplitude = comp("Config").layer("Config").effect("Easter Egg & Star Position, Rotation & Scale Amplitude")("Slider"); // 20
loopTime = 60;
t = time % loopTime;
wiggle1 = wiggle(frequency, amplitude, 1, 0.5, t);
wiggle2 = wiggle(frequency, amplitude, 1, 0.5, t - loopTime);
linear(t, 0, loopTime, wiggle1, wiggle2)


Return to posts index

Dan Ebberts
Re: Irregular Wiggle Expression Between Different Compositions
on Mar 6, 2018 at 4:52:26 pm

It looks like you have it set up so the seed changes every frame, which would give the result you're seeing.

Dan



Return to posts index

Kristian Matthews
Re: Irregular Wiggle Expression Between Different Compositions
on Mar 6, 2018 at 5:11:27 pm

is that what the second parameter is for, I was under the impression true meant it stays the same over time?

Also, why would the compositions differ, as the first composition behaves as expected still.


Return to posts index


Dan Ebberts
Re: Irregular Wiggle Expression Between Different Compositions
on Mar 6, 2018 at 5:16:13 pm

You're using seedOffset as the seed, which will change every frame because you define it before your seedRandom() statement.

Dan



Return to posts index

Kristian Matthews
Re: Irregular Wiggle Expression Between Different Compositions
on Mar 6, 2018 at 8:51:03 pm

I understand, thanks!

Is there a way I can use the composition's name for a unique seedOffset, my compositions follow the naming pattern `Easter Egg A`, `Easter Egg B`, etc…


Return to posts index

Dan Ebberts
Re: Irregular Wiggle Expression Between Different Compositions
on Mar 6, 2018 at 9:37:05 pm

You could try something like this:

seed = thisComp.name[thisComp.name.length-1];
seedRandom(seed,true);
wiggle(1,100)

Dan



Return to posts index

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