Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Recursive compo length

  • Recursive compo length

    Posted by 55 666 on June 22, 2014 at 11:55 am

    Hello there for my first post on this forum.
    I try to set the duration of a compo and all of its layers. i want to do same things for all nested sub-compo (recursive).
    When i run this script, After effect just freeze!

    Reccursive_fit_length = function(Compo,T)
    {
    var tgt_AE = ((T+1)/25); //convert time for AE (Divide per FPS)
    Compo.duration = tgt_AE; //change duration of the compo
    if (Compo.layers.length >= 1)
    {
    for (i=1;i<=(Compo.layers.length);i++) //for all layers
    {
    var lay = Compo.layers[i];
    //$.writeln(lay.name)
    if (lay.source instanceof CompItem){Reccursive_fit_length((lay.source),T)}//if we have a sub-compo, do the same (recursive)
    lay.outPoint = tgt_AE; //set layers to the same duration
    }//end loop layers
    }//end if at least one layer
    }//end fn
    Reccursive_fit_length(app.project.item(1),400)

    55 666 replied 11 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies

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