Page 1 of 1
Trim comp to longest layer script?
Posted: July 10th, 2007, 11:02 am
by fiveshorts
Hi.
I'm trying to solve this, but just tying my feeble, designer brain in knots...
It's got to be pretty simple, I'm sure:
1. Open comp
2. Identify
longest layer (time)
3. Set
Work Area to longest layer
4.
trim comp to work area
5. Close comp
Any help greatly appreciated

Posted: July 10th, 2007, 2:22 pm
by nab
Hi fiveshorts,
I thought it was easy but for some unknown reasons I can't get it to work properly...maybe other enhancers will take look at it.
- you have to close the "timeline frame" (otherwise only the current comp is updated)..
- error occurred if some layers have been shifted beyond the comp duration
here is my test code (ae7), select comps in the project panel and execute the following script:
http://www.nabscripts.com/Forum/Scripts ... rkArea.jsx
Posted: July 10th, 2007, 2:50 pm
by fiveshorts
Thanks nab,
It's foxing me too, not that I'm any sort of coder — just trying to script as many annoying, repetitive tasks as possible...
I'm happy for it to be an 'in-comp' script, ie. to only be applicable to an open, active comp, if that's easier?
Let's see if anyone else can shed some light.
thanks again.
Posted: July 10th, 2007, 3:00 pm
by fiveshorts
Your script is determining the correct duration of the work area at least... when all layers are inside end point. I couldn't work that one out. Now to get it to see beyond the end, extend the comp duration to the last out point and trim the comp accordingly...
Posted: July 16th, 2007, 5:58 pm
by nab
for further reference...
I noticed Jeff also experienced odd behavior with the workAreaDuration attribute in his rd_RenderLayers.jsx
http://www.redefinery.com/ae/view.php?i ... nderLayers
Look into the code to see how he fixed the problem ( "- 0.001" stuff)