Wednesday, October 03, 2012

AE drop shadows that stay the right way up

I googled it and found an amusingly simple tutorial on youtube which i didn't even have to watch. As it says in the description:

"Check it out. Or you can just put the expression "value-transform.rotation" in the direction property of your drop shadow effect and save yourself the bother of watching the video. Up to you!"

http://www.youtube.com/watch?v=WRBrTJ2xCQU

Tuesday, September 11, 2012

Orient 3D layer to camera properly

Auto-Orienting 3D layers towards the camera doesn't work well in After Effects, since they point towards the camera object itself rather than being parallel to the camera plane and thus usually still look like they're at an angle. I found this expression, (like nearly all expressions, it's by Dan Ebberts) to do it properly. Put it on the Orientation of a 3d layer:


L = thisComp.activeCamera;
u = fromWorldVec(L.toWorldVec([1,0,0]));
v = fromWorldVec(L.toWorldVec([0,1,0]));
w = normalize(fromWorldVec(L.toWorldVec([0,0,1])));

sinb = clamp(w[0],-1,1);
b = Math.asin(sinb);
cosb = Math.cos(b);
if (Math.abs(cosb) > .0005){
 c = -Math.atan2(v[0],u[0]);
 a = -Math.atan2(w[1],w[2]);
}else{
 a = (sinb < 0 ? -1 : 1)*Math.atan2(u[1],v[1]);
 c = 0;
}
[radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]



or you can target a specific camera in the first line, eg 

L = thisComp.layer("Camera 1"); 


Found at: http://forums.creativecow.net/thread/227/21917#21917

Monday, September 03, 2012

YouTube playlist of my animation/shorts

I just made a playlist of my animated shorts/music videos/films because they were kind of lost amongst the endless youtube poops, impromptu technique experiments and footage of live noise shows that makes up the rest of my channel. Mostly really old, hopefully some new work in the not too distant future tho:



http://www.youtube.com/playlist?list=PL8CB4627688BDCD7D&feature=plcp

BONUS: I found some old disks at the weekend and uploaded some random outtakes and early animation test fragments from my 2000 film 'Remarkably Bold Venture of the Rabbit':

Thursday, August 16, 2012

I AM CLEVER.





A way to easily make a WHOLE LOAD of the same style title cards/lower thirds/whateverr with different info in the text fields.

I figured out (from misc threads on the creativecow forums) a way to set up a composition so you can just duplicate it and put the info you need in the title of the comp, and the text will change accordingly. You never even have to open them at all! Just copy, rename and drag the lot into the render queue.

The expression is:
thisComp.name.split("_")[1] 
It goes in 'Source Text'

I put an underscore as the 'split' character but you could use something else, just put whatever character you want in.split("*")

Just change the number in square brackets for each text layer to turn that text into the corresponding word/phrase in the comp title. It counts from zero; I usually leave that for a comp name and 1,2,3 and so on for each on-screen text.

Probably I could have been even CLEVERER but it works.

I'd also probably make one master comp and use expressions in the duplicated comps to connect to it each animated/positioned/scaled/font-size/etc value that might need to be changed, in preparation for the inevitable client amends... (u__u;)>

Tuesday, August 14, 2012

Evidently I haven't drawn anything for like 3 years so now for a while this will be a notepad of useful After Effects Expression clippings I mostly found/stole elsewhere, sometimes modified myself a bit.

Posterize time with offset.

Use it on Time Remapping to make a clip have a low frame rate which falls on a specific frame eg to match another piece of low frame rate animation.

fps=12; 
phase=180; 
posTime =(Math.floor(time*fps+phase/360)-phase/360) /fps; 
valueAtTime(posTime); 

Attach the phase to an Angle expression control and animate with hold keyframes if you need to make it stay in sync with irregularly keyframed animation

fps=12;
phase=effect("Angle Control")("Angle");
posTime =(Math.floor(time*fps+phase/360)-phase/360) /fps;
valueAtTime(posTime); 

I used this to make a live action background play at a lower frame rate perfectly in sync with rotoscoped animation which had different parts done on 2s and 3s, and a few accidental missed frames here and there throwing things off.

Taken from http://forums.creativecow.net/thread/227/13759

Audio files in 3D space!

(EDIT: actually not sure if this is really working properly at alll)

This seemed a bit clunky and confusing to me at first but it appears to work OK and I couldn't have come up with it myself so can't complain. :) Controls the volume and panning of audio layers based on distance from comp/camera. Might try and improve it some time; at the moment it works by you put the expression on the 'Audio Levels' of the audio file and the object controlling the position in space underneath that layer, which isn't a workflow I like really. Will probably attach loudMax and loudMin etc. to master sliders for easier tweaking too.

loudMax = 0; //The loudest that the audio file will ever be in dB
loudMin = -20; // The quietest that the audio file will ever be in dB
close = -10; // The smallest Z value expected
far = 1000; // The largest Z value expected
distance = thisComp.layer(index+1).transform.position[2]; //The Z value of the layer beneath this one
myLevel = linear(distance, close, far, loudMax, loudMin);
myWidth = thisComp.width;
//The following section is new and required for the change to the 'balance' equation:
motionLayer = thisComp.layer(index+1);
halfWidth = motionLayer.width / 2;
halfHeight = motionLayer.height / 2;
balance = motionLayer.toComp([halfWidth,halfHeight])[0]; //This is a new form of this equation that converts the XYZ coords of the layer to screen X coordinates for more realistic panning
leftMult = linear(balance, 0, myWidth, 1, 2);
rightMult = linear(balance, 0, myWidth, 2, 1);
myLeftLevel = myLevel * leftMult;
myRightLevel = myLevel * rightMult;
[myLeftLevel, myRightLevel];

Stolen from 'wuzelwazel' on this olde thread: http://forums.creativecow.net/thread/227/7223#7236