Jump to content
Sign in to follow this  
Beaver

5 expressions that will change your life

Recommended Posts

These expressions save so much time, you might get home earlier tonight just by reading this post. If you've ever animated these sorts of things manually, you'll know what I mean. Most will need to be tweaked to your specific needs, but it's just a matter of playing with the numbers a little, and understanding how they'll change your animation. Here's the goods:

 

Jumpy Wiggle 1 makes wiggle skip and hold rather than move fluidly.

// Jumpy Wiggle 1 (moves at a random FPS)
v=wiggle(5,50);
if(v < 50)v=0;
if(v > 50)v=100;
v

 

Jumpy Wiggle 2 is similar to 1, but works at a defined FPS so your "jump" will happen at a regular pace.

// Jumpy Wiggle 2 (moves at a defined FPS)
fps=5; //frequency
amount=50;  //amplitude
wiggle(fps,amount,octaves = 1, amp_mult = 0.5,(Math.round(time*fps))/fps);

 

Inertial Bounce is like making your moves "rubbery." Layers will overextend, then settle into place on position and rotation keyframes.

// Inertial Bounce (moves settle into place after bouncing around a little)
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}
}
if (n == 0){
t = 0;
}else{
t = time - key(n).time;
}

if (n > 0){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = .05;
freq = 4.0;
decay = 2.0;
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}

 

Sometimes you just want something to move constantly without keyframing it. Use throw.

// Throw (move at a constant speed without keyframes)
veloc = -10; //horizontal velocity (pixels per second)
x = position[0] + (time - inPoint) *veloc;
y = position[1];
[x,y]

 

Same as throw, but for rotation.

// Spin (rotate at a constant speed without keyframes)
veloc = 360; //rotational velocity (degrees per second)
r = rotation + (time - inPoint) *veloc;
[r]

 

This is an awesome script works like a charm in AE. I was just wondering how do I get it to work on C4D? I tried using the COFFEE tag but hasn't worked yet for me. Thanks again for these scripts (awesome timesavers)

Share this post


Link to post
Share on other sites
Does anyone know of an equivalent to Inertia Bounce in Cinema 4D?

The Jiggle deformer (Mocca module) does this. It has the added advantage of deforming the object as well - try spinning an object to see instant jelly/jello.

Share this post


Link to post
Share on other sites

not key framing is learning the program. There is a reason they built in the ability to scrip motion, plus you can achieve a smoother motion in half the time and be able to make adjustments faster then beating the curves to death.

Share this post


Link to post
Share on other sites

Just wondering if anyone knows the easiest way to replicate inertial bounce in C4D?

 

I tried with Xpresso and the closest I got was CS_Springnull. But you can use the delay effector in mograph or attach a spring constraint to a null you keyframe and attach your object to the spring constraint.

Share this post


Link to post
Share on other sites

I tried with Xpresso and the closest I got was CS_Springnull. But you can use the delay effector in mograph or attach a spring constraint to a null you keyframe and attach your object to the spring constraint.

 

Yeah that CS_Springnull is awesome. Thanks for that.

Share this post


Link to post
Share on other sites

Here's some animation preset's I made for inertial bounce.

 

There's three of them - put them in After Effects CS4>Presets>User Defined to access them within the Effects & Presets menu.

 

The first, InertialBounce, simply adds Beaver's expression to the selected layer's Position value.

 

The second and third, InertialBounce_P_key and InertialBounce_S_key, add the expression to Position and Scale respectively, but also tie it to three effect sliders, so that you can keyframe the amount of bounciness. This is very useful if you are bouncing a camera's moves, yet have some layers a long way from the camera and others close up. Note that these preset's don't work directly on Cameras and Lights since those cannot have effects applied. In this case parent them to a 3D null and apply the preset to the null.

 

One small gotcha is that if you apply InertialBounce_P_key and then immediately apply InertialBounce_S_key (or vice versa), for some reason it erases the first set of effects. You need to deselect the Slider effects before applying the second preset.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...