Discussion:
Randomizing multiple layers to fade from 0-100 percent opacity..
(too old to reply)
I***@adobeforums.com
2006-11-20 20:07:53 UTC
Permalink
I'm quite new to expressions but they intrigue me and I'm sure that there's some clever way to get my layers to flicker on, stay on and in a random order..
My comp has 170 circles (illustrator based layers) each on their own layer.
Is there some way I could use some code on a master layer and have the randomness apply to all slave layers?
Please, please, please help!

Ian
d***@adobeforums.com
2006-11-20 20:53:45 UTC
Permalink
Hi
try this;

fadeMin = 12;
fadeMax =100;
fadeDuration = 12;

seedRandom(index,true);
fadeStart = random(fadeMin,fadeMax-fadeDuration);
d = thisComp.frameDuration;

linear(time,fadeStart*d,(fadeStart+fadeDuration)*d,0,100)

All layers will fade in between frame 12+100
d***@adobeforums.com
2006-11-20 21:19:46 UTC
Permalink
Hi

You have to type the code only once.
go to Edit>Copy Expression>drag with rhe mouse over all the other layers and paste!Cool, isn't it?
I***@adobeforums.com
2006-11-20 21:07:15 UTC
Permalink
This works great. thank you. How could I modify this to not fade on but rather just "pop" on. Any suggestions from anyone? I suppose so that they could all have appeared by 170 frames, allowing one frame per layer. I'll just time-remap this comp to fit the time I need it in.
I***@adobeforums.com
2006-11-20 21:26:17 UTC
Permalink
That's rad.
d***@adobeforums.com
2006-11-22 05:13:39 UTC
Permalink
Hi

How could I modify this to not fade on but rather just "pop" on... I suppose
so that they could all have appeared by 170 frames





have you tried using Animation>Keyframe Assistant>Sequence Layers?
it's probably easier this way.
I***@adobeforums.com
2006-11-22 05:31:09 UTC
Permalink
wow. didn't know that sequence layers existed. thanks. will definitely come in handy in the future. I had built the layers in illustrator using control+d to duplicate my circle 170 times. problem with this was that they were all in a neat, one-after-the-other order. then, expanded my single layer to 170 consecutive layers.

your first code ended up working perfectly. just decreased the fade interval to 3 frames. then precomped them, applied time-remapping to the precomp and slid the last keyframe to taste.

as if I haven't said thanks enough, thanks. I'm presently reading up on expressions in the 7.0 users guide. wuddu-ya-know... algebra did pay off from high school.
Loading...