Beaver 1 Report post Posted October 17, 2007 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] A shoutout to the brilliant folks at aenhancers.com who provided in whole or in part the basis for all of these expressions. Quote Share this post Link to post Share on other sites
brandj 0 Report post Posted October 17, 2007 Nice! Inertial Bounce is hot. Quote Share this post Link to post Share on other sites
Cutty Pastey 0 Report post Posted October 17, 2007 10 master class points to you! especially for the Inertial Bounce. you sexy bitch you Quote Share this post Link to post Share on other sites
C.Smith 0 Report post Posted October 17, 2007 Awesome. Now I'm going to make Inertial Bounce and Jumpy Wiggle in coffee for C4D **wrings hands with evil intention** Thanks, Beav!! Quote Share this post Link to post Share on other sites
TyMotion 0 Report post Posted October 17, 2007 Very Nice! Thanks alot. Quote Share this post Link to post Share on other sites
ynaka 0 Report post Posted October 17, 2007 I ruv it! Inertial bounce is dope. Quote Share this post Link to post Share on other sites
kitkats 0 Report post Posted October 17, 2007 Cool. Jumpy wiggle 1 is more-or-less what I'm usually trying to end up with 80% of the time I use the Wiggler. Thanks. Quote Share this post Link to post Share on other sites
basilisk 0 Report post Posted October 18, 2007 Fantastic - loving inertial bounce. Request that you repost in resources so it doesn't get buried... Quote Share this post Link to post Share on other sites
Boost 0 Report post Posted October 18, 2007 thumbs up for the inertia bounce - priceless. cheers Beaver Quote Share this post Link to post Share on other sites
basilisk 0 Report post Posted October 18, 2007 You're underselling inertial bounce - you can put it in your scale parameter for squash and stretch bounciness, I even tried it with CC Bend It, to create a bendy rubber stick (apply it to the bend parameter, obviously) Perhaps it could be used with puppet pins to create secondary motion in cartoon animation (I haven't tried this yet)? Quote Share this post Link to post Share on other sites
zook 0 Report post Posted October 18, 2007 (edited) Brilliant. Thanks again. Edited October 18, 2007 by zook Quote Share this post Link to post Share on other sites
microdot 0 Report post Posted October 18, 2007 nice. On throw, I wonder how you'd make it loop across the screen on one axis (or both), so that when the left most edge exited the frame, it would re-emerge on the right side, while still exiting on the left. Kinda like an offset loop, but with expressions. hmmmmm? Quote Share this post Link to post Share on other sites
graymachine 0 Report post Posted October 18, 2007 (edited) nice.On throw, I wonder how you'd make it loop across the screen on one axis (or both), so that when the left most edge exited the frame, it would re-emerge on the right side, while still exiting on the left. Kinda like an offset loop, but with expressions. hmmmmm? You'd have to stick with offset. An expression can't make an object appear in two places at the same time. But, if it can leave the screen, you could do this: startPos = 250; endPos = thisComp.width; end = thisComp.duration; x = linear(time, 0, end, -startPos, endPos); [x, value[1]] Made an edit.. "startPos" has to be a sort of fudge factor. If you are using AE text, expressions cannot retrieve the width of a text layer. But, if you're layer has a fixed with, then you can use: startPos = thisLayer.width; endPos = thisComp.width; end = thisComp.duration; x = linear(time, 0, end, -startPos, endPos); [x, value[1]] Edited October 18, 2007 by graymachine Quote Share this post Link to post Share on other sites
microdot 0 Report post Posted October 18, 2007 cool, thx. BTW - that gif ani rules! Where the hell is that from? Guy got POPPED! Quote Share this post Link to post Share on other sites
chips 0 Report post Posted October 18, 2007 havent really used expressions in AE much. want to test these though. Do I create a new camera and alt click on it's position property and then copy one of these codes? Quote Share this post Link to post Share on other sites
graymachine 0 Report post Posted October 18, 2007 http://www.youtube.com/watch?v=Z6mXfFTOxbM Quote Share this post Link to post Share on other sites
graymachine 0 Report post Posted October 18, 2007 havent really used expressions in AE much.want to test these though. Do I create a new camera and alt click on it's position property and then copy one of these codes? You put them on any property you want. The golden rule with expressions is: Expressions ONLY do what you can otherwise do with keyframes. Their purpose is to simplify otherwise complex keyframe animation. Quote Share this post Link to post Share on other sites
pdeb 0 Report post Posted October 18, 2007 You put them on any property you want. The golden rule with expressions is: Expressions ONLY do what you can otherwise do with keyframes. Their purpose is to simplify otherwise complex keyframe animation. Well said, Harry, and great thread, it's spurred me to share one of my recent effects involving expressions: a little while back I needed to make an oscillating or 'crenelated' spiral path: http://members.shaw.ca/pdebay/cren_spiral.png With the help of, who else, Dan Ebberts, and nab's Create Custom Effect script, I made this into an editable effect - it's tied to the Write-On effect, but you can easily pick-whip the output to any positional-based parameter. It was created for a particular purpose (and perhaps limited in its use), but in the spirit of community, the archive is here: http://members.shaw.ca/pdebay/PDB_Crenelat...ral_beta0.1.zip the archive contains the AE7 .ffx preset, as well as the text you'll have to copy and paste into your "PresetEffects.xml" - if you feel comfortable tweaking that file, of course. As always, I recommend backing up your work and your .xml file. Happy spiralling, Peter Debay Freelance After Effects Motion Graphics & Compositing http://members.shaw.ca/pdebay Quote Share this post Link to post Share on other sites
pdeb 0 Report post Posted October 18, 2007 (edited) I would be remiss if I didn't post the position expression for those not wanting to download the custom effect: center=[thisComp.width/2,thisComp.height/2]; rMax = 240; //maximum radius decay = 0.3; //decay freq = 6; //frequency aStart = 0; //start angle offset aRate = 220; //rotation rate offsetFactor = 12; //smoothness r = rMax/Math.exp(time*decay); a = degreesToRadians(aStart + aRate*time); offset = (r/offsetFactor)*Math.sin(freq*time*Math.PI*2); center + [Math.cos(a),Math.sin(a)]*(r + offset); Happy spiralling, Peter Debay Freelance After Effects Motion Graphics & Compositing http://members.shaw.ca/pdebay Edited October 18, 2007 by pdeb Quote Share this post Link to post Share on other sites
C.Smith 0 Report post Posted October 18, 2007 I did a quick mod of CS_VibrateNull with a stutter function to match the Jitter AE script above. (Stutter at zero equals stutter off). Stutter Quote Share this post Link to post Share on other sites
lavaworks 0 Report post Posted August 15, 2008 Thank you ! very much! One question: if my object rotation and or position is linked to other object...how should i put this to work together ? the object rotation is linked like this : thisComp.layer("Red Solid 2").transform.rotation what changes should i put to your code ? =) thank you // 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; } Quote Share this post Link to post Share on other sites
milkshake 0 Report post Posted August 15, 2008 Just put the code on Red Solid 2 Quote Share this post Link to post Share on other sites
milkshake 0 Report post Posted August 15, 2008 Just put the code on Red Solid 2 Quote Share this post Link to post Share on other sites
the_Monkey 8 Report post Posted August 15, 2008 I tried all these expressions and my life still sucks. Please advise. -m Quote Share this post Link to post Share on other sites
xdozex 0 Report post Posted August 16, 2008 see a therapist and eat a muffin...one will make your life better. Probably the muffin. Quote Share this post Link to post Share on other sites