Creative Communities of the World Forums

The peer to peer support community for media production professionals.

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

  • Refer to a value outside of the comp

    Posted by Jerome Laville on April 29, 2020 at 1:23 pm

    Hi,

    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.

    Jerome Laville replied 4 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    April 29, 2020 at 2:10 pm

    Sure. It might look something like this:

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

    Dan

  • 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.

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