mandag den 23. november 2009

AE - If Expression and Chek box effect.

Dammit... have to reinstall my After effect, and all my plugins.
my serial stoped working today.. mabye my timemachine can help !?

lets try..

didn work.. argh, have to get my copy of CS3 ad work then...(hmmm CS4 might miss you, CS5 is just around the corner).

back to bussines...

if (thisComp.layer("Null 1").effect("checkbox control")("Checkbox")==0)Opacity=0
if (thisComp.layer("Null 1").effect("checkbox control")("Checkbox")==1)Opacity=100

so.. there is a checkbox effect on layer "null 1" and it controles the opacity.
and i belive you also can use > < instead of = in the if expression.

i better try this out tommorow. (and get som spell cheking on this as well.. lol)

mandag den 16. november 2009

Inmprt C4D into AE (after Effects)

Just in case you forget you brain some where sebabba... here is how to import C4D into After effects.

http://greyscalegorilla.com/blog/2009/10/how-to-export-your-scene-from-cinema-4d-to-after-effects/

Thanks GrayScaleGorilla

torsdag den 5. november 2009

2D o 3D - toComp

//graymachine.com


The idea is that you can apply the equivalent 3D location to any 2D location. This might not sound exciting. But, think of all the 2D parameters out there, like lens flare location, Shine source, beams, etc. It is probably my most commonly used expression.

But, the basic idea is this:

layer = thisComp.layer("Null 1")
layer.toComp([0,0,0])

Note: I intentionally left off the semicolon, as you techinically don’t need it in this case. Therefore, all you need to do is pickwhip your layer where the “layer =” variable is.javascript:void(0)

AE - Position - Y Axis Jitter

//graymachine.com - Y Axis Jitter

This is from Lesson 5 of my expressions series. This creates a random jittery motion in the Y axis. You can modify probability to make or less jitter, and the pos variable to define how large the jitter is.

// Y Axis Jitter
probability = 8 ; //higher is less likely
pos = 50;

val = random(-probability-2, 1);
m = clamp(val, 0, 1);
y = wiggle(10, pos*m)-position;
value + [0, y[1]]

Opacity - Snap Zoom In/Out

//graymachine.com - Snap Zoom In/Out

This is a cool expression to use on text. It creates a “snap” zoom on the in and out of the layer by modifying scale.

//Snap zoom in and out: apply to scale
snapScale = 300; //percent of scale to zoom

trans = 4; // transition time in frames
trans = trans * thisComp.frameDuration;
inTrans = easeOut(time, inPoint, inPoint + trans, [snapScale,snapScale], [0,0]);
outTrans = easeIn(time, outPoint, outPoint - trans, [0,0], [snapScale, snapScale]);
value+ inTrans + outTrans

If you prefer to use Z space position instead of scale, try this one:

zoom = 5000; //distance to zoom
trans = 4; // transition time in frames
trans = trans * thisComp.frameDuration;

inTrans = easeIn(time, inPoint, inPoint + trans, [0,0,zoom], [0,0,0]);
outTrans = easeOut(time, outPoint, outPoint - trans*2, [0,0,0], [0,0,zoom]);
value+ inTrans - outTrans

Opacity - Add to opacity

//Found ad graymachine.com
//Autofade: Add to opacity

transition = 50; // transition time in frames
if (marker.numKeys<2){
tSecs = transition / ( 1 / thisComp.frameDuration); // convert to seconds
linear(time, inPoint, inPoint + tSecs, 0, 40) - linear(time, outPoint - tSecs, outPoint, 0, 100)
}else{
linear(time, inPoint, marker.key(1).time, 0, 100) - linear(time, marker.key(2).time, outPoint, 0, 100)
}

Position-Scale-Rotate - the mother of Bounce

//made by Dan Ebberts - mograph.net
//tweaked by graymachine.com

amp = .1;
freq = 2.0;
decay = 2.0;

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

onsdag den 28. oktober 2009

time remap - Start layer ad first marker

//Paul Tuersley - Aenhancers.com

firstMarkTime = thisLayer.marker.key(1).time;
if (time >= firstMarkTime) {
time - firstMarkTime;
} else {
0;
}

Opacity - depentet of distance to camera

//Atomic - Aenhancers.com

camSource=thisComp.layer("Camera 1").position;
footSource=thisComp.layer(index).position;
minDist=1000;
maxDist=2500;
minBright=0;
maxBright=100;

distance=length(footSource,camSource);
darken=ease(distance,minDist,maxDist,maxBright,minBright);

torsdag den 15. oktober 2009

Wiggle - in 3D

//Wiggle i 3 diminsioner.

a=wiggle(3,25);
b=wiggle(2,10);
c=wiggle(1,180);
[a[0],b[1],c[2]]

Wiggle - Start or stop wiggle at specific time

//Start or stop wiggle at specific time

timeToStart = 2;
if (time > timeToStart){
wiggle(3,25);
}else{
value;
}

-----

timeToStop = 4;
if (time > timeToStop){
value;
}else{
wiggle(3,25);
}

-----

timeToStart = 2;
timeToStop = 4;

if ((time > timeToStart) && (time < timeToStop)){
wiggle(3,25);
}else{
value;
}

Position - Wiggle loop

//Wiggle loop

freq = .5;
amp = 20;
loopTime = 3;
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)

mandag den 12. oktober 2009

Position - Bounce 3

// Another bouncing effect.
//Atomic - aenhancers.com

maxDev = 122.20; // max deviation in pixels
spd = 8; //speed of oscillation
decay = 1.0; //how fast it slows down

t = time - inPoint;
x = position[0];
y = position[1];

//Apply v to the axis you want to modulate.
v = position[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);
//y = position[0]*position[1]/v;

[v,y]

Start rotating when approaching a MARKER

//continue rotaning each MARKER
//lloydalvarez - aenhancers.com

f=5; //duration in frames of rotation, set to zero if you want it to click
d=20; //degrees to rotate


f=framesToTime(f, fps = 1.0 / thisComp.frameDuration);
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (time > marker.key(n).time && n < marker.numKeys){
n++;
}
r=(d*(n-1)) + value;
linear (time,marker.key(n).time-f,marker.key(n).time,r,r+d);
}


//oscillate rotation back and forth at MARKERS
//lloydalvarez on AE ENHANCERS.COM

f=5; //duration in frames of rotation, set to zero if you want it to click
d=20; //degrees to rotate

r=value;
f=framesToTime(f, fps = 1.0 / thisComp.frameDuration);
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (n%2) {d=d*-1; r=r-d;}
linear (time,marker.key(n).time-f,marker.key(n).time,r,r+d);
}



//And now with a wiggle

freq=24; //wiggle frequency in frames per second
s=0; //wiggle start amount
d=20; //amount to increase wiggle at each marker
f=15; //duration in frames of transition to next amount, set to zero if you want it to click

f=framesToTime(f, fps = 1.0 / thisComp.frameDuration);
n = value;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (time > marker.key(n).time && n < marker.numKeys){
n++;
}
r=(d*(n-1))+s;
a=linear (time,marker.key(n).time-f,marker.key(n).time,r,r+d);
wiggle(freq,a);

}

torsdag den 1. oktober 2009

Crummy clients previews. Make AVI

Quicktime.

(MAC and PCU) use Quicktime Pro, and export for web.
and you will get a nice clean and small film, ready for your client and you Iphone.

Windows Media.

(PC)
After Effects out put modul.
Export as Windows media video 9.

I usual use a 512*288 (16/9) version as source file.

onsdag den 30. september 2009

Load sound into Cinema 4D 11.

//source : http://forums.creativecow.net/thread/19/863470
// another sound into cinema thingy :
http://forums.cgsociety.org/archive/index.php/t-277132.html
http://www.wonderhowto.com/how-to/video/how-to-work-with-sound-in-cinema-4d-s-mograph-63814/view/

First open some project (at least a cube... or else...)
Open the Timeline / File / Add Special Tracks / Sound...
In the Attributes-Manager import your sound...
Make sure it’s either .aif or .wav / 44100 Hz 16 Bits... (otherwise it won’t show up)...
Play your sound...
In the viewport check “Play Sound During Animation”...

mandag den 28. september 2009

Count to 9

//count to 9 loop.
//ngambles on 07/18/2009, 9:39 am Videocopilot.net

You can use the modulus operator (%). It divides the two values and returns the remainder.

Math.floor( time ) % 9

-----------------------------------------------------------------------------------

This will count from zero to eight, resulting in 9 unique numbers that change every second. To get it to count from 1 to 9 just add 1.

Math.floor( time ) % 9 + 1

-----------------------------------------------------------------------------------

To make it change faster multiply time by some number greater than 1.
The code you want is...

Math.floor( time ) % 10

onsdag den 23. september 2009

Time Remap - Simulate a "scrubbing" effect

//Made by Dan Ebberts from VideoCopilot

tmin = 4.125; //minimum segment duration(can't be zero)
tmax = 19.25; //maximum segment duration = 0;
initialSeed = 11;

end = 0;
j = initialSeed;
while (time >= end){
j +=1;
seed_random(j,true);
start = end;
end += random(tmin,tmax);
}

targetTime = random(this_comp.duration);
seed_random(j-1,true);
dummy=random(); //this is a throw-away value
oldTime = random(this_comp.duration);
linear(time,start,end,oldTime,targetTime)

Count 0-100

::Count up from 0 - 100
::made by ngambles from videocopilot forum

max = 100;
v = Math.floor(time * 5);
if (v >= max){
    max;
}else{
    v;
}

Position - scale - Controle time

:: Controle time - with a slider 0-100 %
:: made by ngambles form videocopilote forum

sld = (effect("Slider Control")("Slider"));

num = thisProperty.numKeys;
t0 = key(1).time;
tn = key(num).time;
t = linear(sld,0,100,t0,tn);

thisProperty.valueAtTime(t)

Text - Jumpy Text

Hmm.. Den her kan jeg ikke lige lægge op, den giver problemer med html'en

http://www.videocopilot.net/forum/viewtopic.php?f=5&t=10495

loop - simple

//need two keyframes to loop

loopOut(type="cycle")
----
loopOut(type="pingpong")
----
loopOut(type="continue")
----
loopOut(type="offset")

and of course you can also use "In", so the loop happen before the keyframes, so it go'es like...


loopIn(type="cycle")
----
loopIn(type="pingpong")
----
loopIn(type="continue")
----
loopIn(type="offset")



Camera - Auto-orientation - Follow cam

//Auto-orientation - Follow cam (Y axe)

delta = toWorld(anchorPoint) - thisComp.activeCamera.toWorld([0,0,0]);
radiansToDegrees(Math.atan2(delta[0],delta[2]))

Wiggle - Start or stop wiggle at specific time

//Start or stop wiggle at specific time

timeToStart = 2;
if (time > timeToStart){
wiggle(3,25);
}else{
value;
}

-----

timeToStop = 4;
if (time > timeToStop){
value;
}else{
wiggle(3,25);
}

-----

timeToStart = 2;
timeToStop = 4;

if ((time > timeToStart) && (time < timeToStop)){
wiggle(3,25);
}else{
value;
}

Position - Position one layer between two others

//Position one layer between two others

(thisComp.layer(1).position + thisComp.layer(2).position)/2

Position - Wiggel in 3d

//Wiggel i 3 diminsioner.

a=wiggle(3,25);
b=wiggle(2,10);
c=wiggle(1,180);
[a[0],b[1],c[2]]

AND 2 Dimentions:

a=wiggle(3,25);
b=wiggle(2,10);
[a[0],b[1]]


Position - Bounce 2

//Position Bounce

surface = [320, 480]; //the position of the ìbounceî surface
apogee = [320, 50]; //the ìapogeeî of the bounce
period = 1.5; //the length of time from surface to apogee
t = time % (period * 2);
if (t > period) t = 2 * period - t;
linear(Math.sin(t * Math.PI / period), 0, 1, surface, apogee)

Position - Bounce

//Position (flex) Bounce.

veloc = 18;
amplitude = 60;
decay = 2;
t=time - key(2).time;

if (t<0){value}
else{
x=amplitude*Math.sin(veloc*time)/Math.exp(decay*t);
value + [x,x]
}

Text - Random letters/Random Words

//Random letters:

alphabet="abcdefghijklmnopqrstuvwxyz0123456789";
alphabet[Math.floor(random(alphabet.length))];

Random Words:

words = ["apple","banana","pear"];
words[Math.round(random(words.length-1))];

Position - Sinus Up and down Position

two value's:

//Sinus/Cosnus - Up and down Position

//cos wave
A=0;
B=200;
value+[A,Math.cos(time*10)*B]

//Circle.
A=200;
B=200;
value+[Math.sin(time)*A,Math.cos(time)*B]

One value:

A=0;
B=20;
value+[Math.cos(time*10)*B]

Position - Wiggel loop

Position
//Wiggel loop
//Dan Ebberts.... Again


freq = .5;
amp = 20;
loopTime = 3;
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)

Opacity - Modsat Opacity på target lag

//Opacity - laver modsat Opacity på target lag:

t = thisComp.layer(index-1).opacity
linear(t, 0, 100, 100, 0)
AE POSTWORK blog is virtually just a notepad, where I put all the AE expressions up I finde and use, its so I can easily get to them wherever I am and no matter what computer I sit at. I do not write my own expressions, so all expressions on the page is downloaded from the web,or modify versions i found. and tutorials etc.. I will try to credit those who have made expressions if I can.

Now, with tips and tricks for AE & C4D.
No more forgetting the little tricks and tips I found on my road with After Effects, etc.

Sebabba