Showing posts with label aftereffects. Show all posts
Showing posts with label aftereffects. Show all posts

Friday, March 3, 2017

After Efffects swing (real world physics)

Make sure the "center" of the object, or where you want it to swing from, is the 0,0 (or whatever) anchor point.

ADD to rotation:

// 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 = 8;
freq = 2.0;
decay = 6.0;
value + (v/100)*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}

Wednesday, September 26, 2012

After Effects Number Rolling

Alt + Shift + "=" to open the expression panel with the "text" transform effect open.

numDecimals = 0;
commas = true;
dollarSign = true;
millSuff = true;
beginCount = 10;
endCount = 110;
dur = .85;
t = time - inPoint;
s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals);
prefix = "";
suffix = "";
if (s[0] == "-") { prefix = "-"; s = s.substr(1); }
if (dollarSign) prefix += "$";
if (millSuff) suffix += " MILLION";
if (commas) {
decimals = "";
if (numDecimals > 0){
decimals = s.substr(-(numDecimals + 1));
s = s.substr(0,s.length - (numDecimals + 1));
}
outStr = s.substr(-s.length, (s.length-1)%3 +1);
for (i = Math.floor((s.length-1)/3); i > 0; i--) {
outStr += "," + s.substr(-i*3,3);
}
prefix + outStr + decimals + suffix;
}
else
{
prefix + s + suffix;
}



Wednesday, October 19, 2011

More Wiggle

Just moves on the Y-axis

With the object selected, choose the parameter you want to effect (e.g. position, scale, anchor point, etc.)

w = wiggle(.2,100);
// Above is my variable "w" that will hold my wiggle (home many times per second, how much)
[value[0],w[1],value[2]]
// 0 = x-axis, 1 = y-axis, 2 = z-axis
// "value" says just hold the normal value

Wednesday, September 28, 2011

AfterEffects MotionScript - "random" position

Wiggle is a cool little function in AfterEffects.

Clicking on the "transform parameter" select SHIFT+ALT "=", Animation > Add Expression. Then past this:

wiggle(.2,25)

The first value is the frequency, the second is the amount/change.

AfterEffect MotionScript - Random Scale

segMin = .75; //minimum segment duration
segMax = 1.25; //maximum segment duration
minVal = 5;
maxVal = 10;

end = 0;
j = 0;
while ( time >= end){
j += 1;
seedRandom(j,true);
start = end;
end += random(segMin,segMax);
}
s = random(minVal,maxVal);
endVal = [s,s];
seedRandom(j-1,true);
dummy=random(); //this is a throw-away value
s = random(minVal,maxVal);
startVal = [s,s]
ease(time,start,end,startVal,endVal)