Monday, December 20, 2010

Death Star

Hello there, this is another weekend composite i did in AfterEffects. Yes, i know we've seen many Death Stars hovering over cities before (and YouTube is full of them), but not over mine. So i put one there. The galactic empire reaches earth in search of some "missing droids", with the entire armada of star destroyer cruise ships and the death star.

The only new thing about this composite is the use of expressions in After Effects a.k.a scripts. Cannot escape from coding, can anyone. So the clock seen at the bottom of the video is a scripted one. Here is how to do it:

1. Create a new text layer.
2. Pre-compose the layer and open it.
3. Expand the text layer parameters in the layers panel.
4. Alt + Click on the Source Text's stopwatch icon. This brings up the expression editor for that property.
5. Write in the below code.


var sec = Math.floor(time);

// Mod sec by 60 else it will keep counting.
var secM = Math.floor(sec % 60);

// Function to get a double digit for numbers less than 10
function appendZeros(Number)
{
     var finNum;
     if(Number < 10)
    {
         finNum = "0" + Number;
     }
    else
    {
        finNum = Number;
    }
    return finNum;
}

// Replace "14" as per your choice
"14" + ":" + appendZeros(secM)

[ script editing ]


As you scrub through the timeline you will observe that the second value in the pre-comp is changing as per the second value of the footage. The changes get reflected in the main comp.

[ a frame from the composite ]


Here is the link for the empire strikes back......again...
Yup, no more direct views here. GOTO YouTube and watch.

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

Until next time...

No comments: