Skip navigation
Currently Being Moderated

setting multiple attributes for an effect in one go???

Apr 1, 2012 11:52 AM



i am adding drop shadows to a layer and i wanted to set the distance, opacity and softness in an efficient way. Is it possible to do this on one line?


so far my code is like this, i have only set the distance here:



var comp = app.project.activeItem;


comp.layer(1).property("Effects").addProperty("Drop Shadow").Distance.setValue(15);


any thoughts??





  • Currently Being Moderated
    Apr 1, 2012 1:48 PM   in reply to samwilliams21

    Unless you have the script apply a preset with your effect and parameter settings, this is probably the best I could come up with:


    var comp = app.project.activeItem;

    var myEffect = comp.layer(1).property("Effects").addProperty("Drop Shadow");"Distance").setValue(15);"Opacity").setValue(25);"Softness").setValue(10);




    Mark as:
  • Currently Being Moderated
    Apr 3, 2012 2:34 PM   in reply to samwilliams21

    I'm not sure why you would get multiple drop shadows (I don't) but there is something strange going on. It turns out that to get an opacity value of 25%, you actually have to do setValue(63.75). Whatever value you want, multiply it by 2.55 before you do the setValue().



    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points