Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions The right way to precompose a bunch of layers you generate from script?

  • The right way to precompose a bunch of layers you generate from script?

    Posted by Bryan Woods on October 11, 2017 at 6:44 am

    I want to build a visual element to act as a guide. Its composed of a bunch of different native effects and layers. What’s the best way to create this guide in script? Do I generate all the layers individually with their effects, then select all of those recently created layers and precompose? Or is there a way to generate and add to a precomp at the same time? What’s the proper code for accomplishing something like this, and what is most efficient? Once the precomp is made, i also need to set the precomp’s blending mode to screen.

    Bryan Woods replied 8 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    October 11, 2017 at 2:04 pm

    I personally would create the precomp first and then add all the layers inside it. That way you don’t need to worry if you selected the correct layers and such. So steps would be create the precomp and add it to the active composition and set the blending mode
    var myPrecomp =app.project.items.addComp(name, width, height, pixelAspect, duration, frameRate) ;
    var myPrecompLayer = app.project.activeItem.add(myPrecomp);
    myPrecompLayer.blendingMode = BlendingMode.SCREEN ;

    Then, inside it add all the layers. Crefull, since here you have to use the composition variable(myPrecomp), not the layer one.
    myPrecomp.layers.add() //or maybe addText, addShape or whatever you need
    I hope it helped,

    Andrei

  • Bryan Woods

    October 11, 2017 at 3:36 pm

    Awesome, I’ll give this a try. Thanks!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy