Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions set background color of multiple comps?

  • set background color of multiple comps?

    Posted by Tristan Summers on January 30, 2019 at 11:13 am

    HI
    I am used to using dr_CompSetter to set parameters of mutiple comps at once, but it does not do BAckground color.
    Does anyone know of a way to do this?

    background to the background:
    I set background colour to make some black elements visible.
    Resolume’s DXV3 codec only seems to premultiply correctly when background colour is black. Other colours remain in the entirely transparent areas, not just the semi-transparent pixels, so I assume it has to premult with black only. I have about 400 comps to change.
    I could probably just render straight but I want to set background colour anyway.

    Maria Pixamins replied 6 years, 2 months ago 3 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    January 30, 2019 at 5:48 pm

    A little utility script like this will set the background color to black for all the comps in your project:


    function setBGColor(){
    for (var i = 1; i <= app.project.numItems; i++){
    if (app.project.item(i) instanceof CompItem){
    app.project.item(i).bgColor = [0,0,0];
    }
    }
    }
    setBGColor();

    Dan

  • Tristan Summers

    January 30, 2019 at 5:50 pm

    Amazing. Thank you.
    (I must learn javascript)

  • Maria Pixamins

    February 21, 2020 at 3:39 pm

    WoW!
    Can you please give a sign, I am really sure were do you place the script?

  • Dan Ebberts

    February 21, 2020 at 4:31 pm

    I’m not sure exactly what you mean, but you can save the script as a .jsx file wherever you want, and then run it with File > Scripts > Run Script File…

    Dan

  • Maria Pixamins

    February 22, 2020 at 7:41 am

    Worked !!!!
    Wow I have never include a script in a .jsx!

    You’re an expert.

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