Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Adding Fade In & Out using Scripting

  • Adding Fade In & Out using Scripting

    Posted by Jason Ladew on November 12, 2013 at 6:12 pm

    Hello,

    What I would like to do is import a video and add a simple fade In at the beginning (2-3 seconds) and fade out at the end. This seems like something scripting in AE should be able to handle since this will be a repetitive task for many videos.

    Does any one have a simple sample I can use that will get me going on this? This would be much appreciated. Having the general idea on the code involved will enable me to adapt it to using the script from the command line, which is my goal.

    Thanks,

    Jason

    Erik Waluska replied 12 years, 6 months ago 4 Members · 3 Replies
  • 3 Replies
  • John Cuevas

    November 12, 2013 at 6:51 pm

    Autofade

    Johnny Cuevas, Editor
    Thinkck.com

    “I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work.”
    —THOMAS EDISON on inventing the light bulb.

  • Walter Soyka

    November 13, 2013 at 3:41 am

    You could also apply this expression, so that the fade will update even if the layer timing is changed later:

    // set this value to the length of the dissolve you want, in seconds
    dissolveTime = 3;

    // if we don't have enough time to do both full dissolves the way we want, set the dissolve time to half the total duration.
    if (outPoint - inPoint < dissolveTime * 2) dissolveTime = (outPoint - inPoint)/2;

    // use linear interpolation to go from 0 to the nominal opacity value (100 by default, but adjustable or keyframable) as long as we're within dissolveTime seconds of the layer's in point,
    // and vice versa for the out point. Otherwise, simply return the nominal value.
    if (time-inPoint <= dissolveTime) linear(time-inPoint,0,dissolveTime,0,value)
    else if (outPoint-thisComp.frameDuration-time <= dissolveTime) linear(outPoint-thisComp.frameDuration-time,0,dissolveTime,0,value)
    else value;

    Walter Soyka
    Principal & Designer at Keen Live
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    RenderBreak Blog – What I’m thinking when my workstation’s thinking
    Creative Cow Forum Host: Live & Stage Events

  • Erik Waluska

    November 13, 2013 at 5:20 pm

    There is also a “Fade In+Out – frames” preset in the “Behaviors” section that fades in and out by however many frames you enter, base on the in and out points of the layer. Harry Frank has a preset called “graymachine auto fade” on his site that uses layer markers to determine the fade duration.

    Erik Waluska
    EAWmedia

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