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