ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Randomize Items in a Grid

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ross Wilcox
Randomize Items in a Grid
on Jul 4, 2018 at 12:14:29 am

I'm trying to create a grid of objects, where each object in the grid changes periodically at random. Currently, I have a precomp that contains my object source layers, and I'm using a slider control expression to randomly toggle the opacity of the layers in the precomp. I then have that precomp duplicated many times in the parent comp to create the grid. However, with this method, all of the objects in the grid change in unison. Now, I can sequence the precomp layers to offset the random changing, however this still produces the same sequence of change for each object in the grid, just offset a little in time. I'm hoping to find a solution that truly makes the object change sequence random for each object in the grid. Is there any way to automate this?

Every source layer in the Layers Source pre-comp has an opacity expression: s=comp("Ross Attempt").layer("Layer Control").effect("Layer Selector")("Slider").value;
(Math.round(s)==index) ? 100 : 0

which links to the slider control in the parent comp, which has an expression on the slider: seedRandom(Math.floor(time*4), timeless=true);
random(1,8); //8 because I have 8 source layers in my precomp


Return to posts index

Kalleheikki Kannisto
Re: Randomize Items in a Grid
on Jul 4, 2018 at 7:23:39 am

Try like this:
seedRandom(index+Math.floor(time*4),true);
s = random();
(s<.5) ? 100 : 0

This uses the layer index to randomize the sequence.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Jacob Roth
Re: Randomize Items in a Grid
on Jul 5, 2018 at 7:30:51 pm

Dan Ebberts has a random grid at motion script.

http://www.motionscript.com/expressions-lab-ae65/random-grid-movement.html


Return to posts index

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