ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

script access to nested composition layers

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Sasha Akhavi
script access to nested composition layers
on Jun 27, 2016 at 4:05:54 am

This seems like such a simple issue, but I can't find information on it in the AE scripting guide or online.

I have a composition which contains multiple layers that are themselves compositions that contain layers. (I imported a Photoshop file with 2 levels of nested layers).

I am wanting to script the action of turning all the layers and their sublayers into 3d layers. But I can't figure out how to access the nested layers.

Suppose I am viewing the main composition as my active item. I've tried app.project.activeItem.layer(1).layers, but this doesn't work, because app.project.activeItem.layer(1) is an AVLayer, and AVLayer objects don't have their own layer collections to access. But in the app UI, that layer(1) is clearly a CompItem, and CompItems should have accessible layer collections.

Thanks for any help you can provide!


Return to posts index

Walter Soyka
Re: script access to nested composition layers
on Jun 27, 2016 at 11:09:45 am

[Sasha Akhavi] "layer(1) is clearly a CompItem, and CompItems should have accessible layer collections."

app.project.activeItem.layer(1) is not a CompItem, it's an AVLayer.

app.project.activeItem.layer(1).source, however, is a CompItem, and be addressed the way you expect.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Sasha Akhavi
Re: script access to nested composition layers
on Jun 27, 2016 at 1:07:48 pm

Fantastic, thanks, I'll try this.


Return to posts index

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