ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Refer to a value outside of the comp

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jerome Laville
Refer to a value outside of the comp
on Apr 29, 2020 at 1:23:00 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.


Return to posts index

Dan Ebberts
Re: Refer to a value outside of the comp
on Apr 29, 2020 at 2:10:41 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



Return to posts index

Jerome Laville
Re: Refer to a value outside of the comp
on Apr 29, 2020 at 2:14:30 pm

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]