Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Change multiple comps duration script

  • Change multiple comps duration script

    Posted by Marcelo Schiavon on April 27, 2013 at 8:45 pm

    Hi, first of all, thanks for all the help that you’ve provided already. But now I’m registering to the forums and making my first post because it seems that this was not asked before. Maybe it’s too simple but god knows I googled and googled with no good enough results.

    I want to create a simple expression that would allow me to add a specific amount of frames to the selected comps.
    I need to add frames to some of the pre-comps on my projects.
    Is this doable?

    Thanks.
    Marcel.

    Marcelo Schiavon replied 13 years, 3 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    April 27, 2013 at 9:14 pm

    >Is this doable?

    Not with an expression, but a small script like this should work:


    {
    var numFrames = 10; // number of frames to add
    var selectedComps = app.project.selection;
    var curComp;
    for (var i = 0; i < selectedComps.length; i++){
    if (selectedComps[0] instanceof CompItem){
    curComp = selectedComps[i];
    curComp.duration += numFrames*curComp.frameDuration;
    }
    }
    }

    Dan

  • Marcelo Schiavon

    April 27, 2013 at 9:41 pm

    thanks a lot but I’m sorry but it doesnt seem to work.

    I changed the “numFrames” value to a 100 but it does not add any duration to the selected pre-comps.

  • Marcelo Schiavon

    April 27, 2013 at 9:44 pm

    Dan! my bad! it does work perfectly fine! i was selecting the comps from the timeline and not from the project panel. Thanks a lot!!

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