FORUMS: list search recent posts

Recursive compo length

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
camille lymer
Recursive compo length
on Jun 22, 2014 at 11:55:32 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&lt;=(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)


Return to posts index

Benoit Kergosien
Re: Recursive compo length
on Jun 22, 2014 at 2:51:38 pm

Hello Camille,

Did you try the script rd: Composition Setter by Jeff Almasol?
http://www.redefinery.com/xae/view.php?item=rd_CompSetter

Benoit


Return to posts index

camille lymer
Re: Recursive compo length
on Jun 22, 2014 at 3:52:37 pm

great, It do the job!!
Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]