Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
User avatar
Mules
Topic Author
Posts: 3
Joined: Mon Feb 05, 2018 12:20 am

Add layer to comp

Tue Feb 13, 2018 4:07 pm

Hi!

Is it possible to add an existing asset (solid) from the project window (asset library) to the current composition 
via scripting ?

Thanks!
 
User avatar
zlovatt
Posts: 18
Joined: Mon Oct 31, 2016 5:00 pm
Location: Los Angeles
Contact:

Re: Add layer to comp

Wed Feb 14, 2018 12:55 pm

Yes, you certainly can.

Look at "layers.add" : http://docs.aenhancers.com/layers/layer ... ection-add



var item = // your solid;
var comp = app.project.activeItem;
var itemAsLayer = comp.layers.add(item);
 
User avatar
Mules
Topic Author
Posts: 3
Joined: Mon Feb 05, 2018 12:20 am

Re: Add layer to comp

Thu Feb 15, 2018 7:06 am

Thanks for the snippet!! And the link,

m,

Who is online

Users browsing this forum: No registered users and 2 guests