recursively set composition lengths

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
z00story
Posts: 8
Joined: September 4th, 2008, 10:29 am

I thought I saw a script that did this a few years back on aescripts, but I can't seem to find it.

Say you have a layer, nested deep within a structure of pre-comps.

I want to select that layer, then hit a script to adjust the length of every parent comp to the length of that layer.

My problem is, I'm having trouble finding the code to select "parent" layers. While parent is quite common in javascript, that term seems to be reserved for layer parenting in AE.

Any tips?
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

It's not very straight forward, I would use the AVItem usedIn attribute on the parent comp, then on it's parent comp, etc.:

Code: Select all

app.project.item(index).usedIn
z00story
Posts: 8
Joined: September 4th, 2008, 10:29 am

Thanks for this, I get it now.

Now I'm struggling with trying to make the arrays necessary to find every "usedIn" item. I need to go up through parents until there are no more parents, I also need to go "sideways" that is, find every usedIn[] array instance that is not undefined. I guess spanning both ways is confusing me...

Is this making sense?
Post Reply