Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to stop rendering when there are no pixels in the composition

  • Expression to stop rendering when there are no pixels in the composition

    Posted by Avinash Ramanath on December 21, 2016 at 9:57 am

    Scenario: Text crawler
    I am dynamically passing a string to a text layer which is crawling at below speed

    rate = 2; //value in px/sec.
    value – [rate*timeToFrames(time),1]

    This text layer is placed inside a comp named RenderComp which I will render as TGA using Media Encoder.

    The standard duration of RenderComp is set to 5 minutes. Is there a way to dynamically set the timing of the composition based on the string length, so that it does not render blank frames when the string is shorter.

    rate = 2; //value in px/sec.
    value - [rate*timeToFrames(time),1]

    Dan Ebberts
    replied 7 years, 3 months ago
    2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    December 22, 2016 at 5:13 pm

    Expressions can’t control the work area or anything else I can think of that would give you the result you’re looking for. You could do it with a script though.


  • Avinash Ramanath

    December 22, 2016 at 5:47 pm

    Dan, I am new to scripting, could you please help me with a script that does what am looking for.

    Pick a footage/footages from a folder (say video1 and video2)
    Import the files inside after effects
    make compositions from the videos
    sequence the compositions
    Render the composition

    I know am asking too much, could you please direct me towards ways of achieving this even if i have to approach an agency.

    Thanks in advance.

  • Dan Ebberts

    December 22, 2016 at 6:24 pm

    This is a simple example that asks you to navigate to a video file and then creates a comp with it.

    function makeComp(){
    var video1 = File.openDialog("Navigate to video file.");
    if (video1 == null || (! video1.exists)){
    alert("No video selected.");
    var myImportOptions = new ImportOptions;
    myImportOptions.file = video1;
    var myFootage = app.project.importFile(myImportOptions);
    var myComp = app.project.items.addComp("video1",myFootage.width,myFootage.height,myFootage.pixelAspect,myFootage.duration,myFootage.frameRate);

    Hopefully that will get you started.


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