Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Refer to a value outside of the comp

  • Refer to a value outside of the comp

  • Jerome Laville

    April 29, 2020 at 1:23 pm


    I have 256 compositions, all very similar and with the same black solid as the top layer. On that solid I have a basic expression that toggles the opacity on and off randomly, off being 10 times more likely than on.

    If I wanted to change the likelihood from 10 to 20, I’d have to go and change the expression in all 256 compositions. Could I avoid that by setting that X number somewhere in my project outside of these compositions, and refer to it? I could then easily play with that number and affect all compositions.

    Many thanks.

  • Dan Ebberts

    April 29, 2020 at 2:10 pm

    Sure. It might look something like this:

    pct = comp(“Controls”).layer(“Controls”).effect(“Percent”)(“Slider”);
    random() < pct/100? 100 : 0


  • Jerome Laville

    April 29, 2020 at 2:14 pm

    That would be it. Thank you so much for this and for everything you do Dan.

Viewing 1 - 3 of 3 posts

Log in to reply.

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