FORUMS: list search recent posts

Adding Fade In & Out using Scripting

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jason Ladew
Adding Fade In & Out using Scripting
on Nov 12, 2013 at 6:12:29 pm


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.



Return to posts index

John Cuevas
Re: Adding Fade In & Out using Scripting
on Nov 12, 2013 at 6:51:57 pm


Johnny Cuevas, Editor

"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.

Return to posts index

Walter Soyka
Re: Adding Fade In & Out using Scripting
on Nov 13, 2013 at 3:41:04 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

Return to posts index

Erik Waluska
Re: Adding Fade In & Out using Scripting
on Nov 13, 2013 at 5:20:34 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

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved