Highlighted

Automatically generate different timeless random numbers on the same layer

Explorer ,
May 12, 2020

Copy link to clipboard

Copied

If I want After Effects to automatically generate a different timeless random numbers on each instance of a duplicated layer, I know how to do that by referencing the index. For example:

seedRandom (index, true);
random ()

What I want to do is similar to that, but I need the different random numbers to be generated in duplicated effects on the same layer.

Obviously, using 'index' won't produce different random numbers between the duplicated effects because the layer number will be the same for all instances of the effect. Instead, what I need is some way to either self-reference the effect name/number, or randomly generate a timeless number without specifying a seed. See what I mean?

(For those who want to know why I need this, I'm using a particle plugin called Stardust, and each of the different Stardust effects on the same layer work together in 3D space. If I put any of the elements on a different layer, I will lose the 3D link between them. I need to duplicate a particular effect dozens of times, and I want it to be able to automatically generate a different wiggle for each. I don't want to have to edit the expressions in all of them, partly because I will probably want to go back a few times and make changes to the original instance and then re-duplicate the others. )

Any ideas?

Thanks!

TOPICS
Expressions

Views

271

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Automatically generate different timeless random numbers on the same layer

Explorer ,
May 12, 2020

Copy link to clipboard

Copied

If I want After Effects to automatically generate a different timeless random numbers on each instance of a duplicated layer, I know how to do that by referencing the index. For example:

seedRandom (index, true);
random ()

What I want to do is similar to that, but I need the different random numbers to be generated in duplicated effects on the same layer.

Obviously, using 'index' won't produce different random numbers between the duplicated effects because the layer number will be the same for all instances of the effect. Instead, what I need is some way to either self-reference the effect name/number, or randomly generate a timeless number without specifying a seed. See what I mean?

(For those who want to know why I need this, I'm using a particle plugin called Stardust, and each of the different Stardust effects on the same layer work together in 3D space. If I put any of the elements on a different layer, I will lose the 3D link between them. I need to duplicate a particular effect dozens of times, and I want it to be able to automatically generate a different wiggle for each. I don't want to have to edit the expressions in all of them, partly because I will probably want to go back a few times and make changes to the original instance and then re-duplicate the others. )

Any ideas?

Thanks!

TOPICS
Expressions

Views

272

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 12, 2020 0
Mylenium LATEST
Most Valuable Participant ,
May 12, 2020

Copy link to clipboard

Copied

The seed number can be any number and since scripts evaluate line by line it can change multiple times in the expression itself even when the function is called up in different places or in a loop. You can therefore easily construct your own obscure formula that generates a new value for every effect duplicate based e.g. on the effects name. you know, you can rename effects easily and include numbers or simply use the overall length of the string. Likewise, you could count the layers, the effects on each layer or any other arbitrary criteria like markers (including again using their comments as text strings), keyframes, masks and so on. These days's there's a million ways and even the old-fashioned way of perhaps adding custom sliders or point control expression helpers could be used. A single 3D point control will already give you 3 values to play around with directly and then you could use their dot and cross products as secondary and tertiary values. This is really endless.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 12, 2020 0