Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Building a slate with Expressions

  • Building a slate with Expressions

    Posted by Jonathan Ficcadenti on November 19, 2014 at 9:46 pm

    Hello trusted Creative Cow community,

    Using After Effects CS6, I’m trying to build an automated slate comp (render comp) where I can simply drop a sequence into a precomp that is nested in my slate comp, and the details of the footage (footage name, total frame count, the current date) will automatically appear as white text on a black frame at the head of the slate comp (frame 0).

    Why must the footage be precomped? Long story, but it needs to be this way.

    So far, I have figured out the ‘DATE’ expression, but the other two (The name of the footage/image sequence that resides in the nested precomp, as well as the total number of frames for that footage/image seuence) is where I’m getting stuck.

    PLEASE HELP! and thank you so much in advance for sharing your expressiony wisdom with me.

    Any questions about my description? please let me know and I will clarify.

    Sincerely yours,

    -Johnny Fixx

    Jonathan Ficcadenti replied 11 years, 5 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    November 19, 2014 at 10:01 pm

    I think the name will be like this:

    comp(“precomp”).layer(1).source.name;

    and the number of frames like this:

    s = comp(“precomp”).layer(1).source;
    Math.round(s.duration/s.frameDuration);

    Dan

  • David Conklin

    November 19, 2014 at 10:07 pm

    Assuming your footage comp is named ‘ftg’ and the footage is the only layer inside that comp, you can access that layer’s properties using the following code:


    var getFtg = comp("ftg").layer(1);

    You can then do getFtg.whatever to get the data that you need. For instance:


    //get the layer Name
    var theName = getFtg.name;

    //duration of layer (secs)
    var getDurSecs = getFtg.source.duration;

    //duration of layer (frames)
    var getDurFrames = getFtg.source.duration * getFtg.source.frameDuration;

    //frame rate of ftg
    var getFrameRate = 1/getFtg.source.frameDuration

    Once you have the info you want, you can combine them into a string. You can use the characters “\r\n” to force a line break if you’d like:


    "Footage Name: " + theName + "\r\n" +
    "Footage FrameCount: " + getDurFrames + "\r\n" +
    "Footage Frame Rate: " + getFrameRate + "fps" + "\r\n";

    Hope this is what you were looking for. Good luck!

    David Conklin
    Motion Designer

  • Jonathan Ficcadenti

    November 19, 2014 at 11:07 pm

    Dan/ David,

    You guys rock! These work great.
    Thank you so much.

    //Jon//

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy