FORUMS: list search recent posts

add drop shadow to layer

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
lars pedersen
add drop shadow to layer
on Dec 15, 2013 at 3:52:53 pm

Trying to create a script thats gonna add a layer with a dropshadow to the 3th layer in every comp in my project for automation but i dont get it.

var myComp = app.project.activeItem;
var backgroundLayer = currentComp.layers.addSolid([93, 5, 2], "Background");

backgroundLayer.Effects.addProperty("Drop Shadow");
backgroundLayer.property("Effects").property("Drop Shadow").property("Softness").setValue([28]);


get the error null is not an object...


Return to posts index

Xavier Gomez
Re: add drop shadow to layer
on Dec 15, 2013 at 5:46:07 pm

currentComp is not defined.


Return to posts index

lars pedersen
Re: add drop shadow to layer
on Dec 15, 2013 at 6:00:13 pm

renamed currentComp to mycomp but now it only works on 1 selected comp and not multiple comps. Do i need a for/while command of some kind??


Return to posts index


Dan Ebberts
Re: add drop shadow to layer
on Dec 15, 2013 at 6:33:59 pm

Yes, yo'll need a loop to do that:


for (var i = 1; i <= app.project.numItems; i++){
if (app.project.item(i) instanceof CompItem){
var myComp = app.project.item(i);
var backgroundLayer = myComp.layers.addSolid([93, 5, 2], "Background", 100, 100 ,1, myComp.duration);
backgroundLayer.Effects.addProperty("Drop Shadow");
backgroundLayer.property("Effects").property("Drop Shadow").property("Softness").setValue([28]);
}
}



Dan



Return to posts index

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