Skip to main content
sambegdouri
Inspiring
August 5, 2015
Answered

How do I add a 3D wiggle expression to a seamless loop expression in After Effects?

  • August 5, 2015
  • 2 replies
  • 1686 views

I am using this xyz wiggle expression for several layer (each layer having slightly different integers to have different movement.

a =wiggle(0.2,150);

b =wiggle(0.15,160);

c = wiggle(0.2,500);

[a[0],b[1],c[2]]

But I want to make it a seamless loop. I found another expression that does this, but it is not in 3d space.

freq = 1;
amp = 110;
loopTime = 3;
//this will be changed to 6 seconds
t = time % loopTime;
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
linear(t, 0, loopTime, wiggle1, wiggle2)

How can I merge the expression?

This topic has been closed for replies.
Correct answer Mylenium

You need 6 wiggles and 3 linear() interpolators - one for each dimension. And since you only want one component of the result, you have to isolate it.

wiggleX1 = wiggle(1, 0.5, t);
wiggleX2 = wiggle(1, 0.5, t - loopTime);

wiggleY1 = wiggle(2, 0.5, t);

wiggleY2 = wiggle(2, 0.5, t - loopTime);

wiggleZ1 = wiggle(1.5, 0.5, t);

wiggleZ2 = wiggle(1.5, 0.5, t - loopTime);

X=linear(t, 0, loopTime, wiggleX1, wiggleX2)[0];

Y=linear(t, 0, loopTime, wiggleY1, wiggleY2)[1];

Z=linear(t, 0, loopTime, wiggleZ1, wiggleZ2)[2];

[X,Y,Z]

Mylenium

2 replies

Mathias Moehl
Community Expert
Community Expert
August 6, 2015

iExpressions also has a looping wiggle, but it cannot control the wiggle amount in each direction separately.

Looping Wiggle Expression | mamoworld

looping_wiggle_0.png

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mylenium
MyleniumCorrect answer
Legend
August 6, 2015

You need 6 wiggles and 3 linear() interpolators - one for each dimension. And since you only want one component of the result, you have to isolate it.

wiggleX1 = wiggle(1, 0.5, t);
wiggleX2 = wiggle(1, 0.5, t - loopTime);

wiggleY1 = wiggle(2, 0.5, t);

wiggleY2 = wiggle(2, 0.5, t - loopTime);

wiggleZ1 = wiggle(1.5, 0.5, t);

wiggleZ2 = wiggle(1.5, 0.5, t - loopTime);

X=linear(t, 0, loopTime, wiggleX1, wiggleX2)[0];

Y=linear(t, 0, loopTime, wiggleY1, wiggleY2)[1];

Z=linear(t, 0, loopTime, wiggleZ1, wiggleZ2)[2];

[X,Y,Z]

Mylenium

sambegdouri
Inspiring
August 6, 2015

thank you. Really appreciate it