Skip to main content
synthetick
Community Expert
Community Expert
December 5, 2023
Answered

seedRandom expression changes results when duplicating comp

  • December 5, 2023
  • 2 replies
  • 480 views

Hi, I’m trying to do something with AE Expressions and they’re not behaving the way I expected. Any Expressions gurus who can advise me? The problem is with seedRandom. My expectation is that if I make a duplicate of this comp, the randomness shouldn’t change because I am using seedRandom. But it does change, and I don’t want that. Did I code something wrong?

This topic has been closed for replies.
Correct answer Mylenium

Not really. The whole setup is designed wrongly from the outset. It would be easy enough to just consistently generate the values in a master comp/ dummy comp and remote-link them to the sub-comps. There is no requirement to convert anything to keyframes.

 

Mylenium

2 replies

Community Expert
December 5, 2023

Even though you give the seed a value and change it to Timeliess = true, the random function still generates a random number. You will need to convert the expression to Keyframes using the Keyframe assistant to make duplicate comps that have the same look.

Mylenium
MyleniumCorrect answer
Legend
December 6, 2023

Not really. The whole setup is designed wrongly from the outset. It would be easy enough to just consistently generate the values in a master comp/ dummy comp and remote-link them to the sub-comps. There is no requirement to convert anything to keyframes.

 

Mylenium

Dan Ebberts
Community Expert
Community Expert
December 5, 2023

I don't think there's a good way to do that. Under the hood, I think the comp id gets factored into the seedRandom calculation. You might be able to use wiggle(), like this, which should give the same result in each duplicate comp:

seedRandom(index,true);
w = rotation.wiggle(0,1)-rotation;
diameter = 2500 + (w/2)*4500;
[diameter,diameter]

 

synthetick
Community Expert
Community Expert
December 6, 2023

Thank you! I have used your expression and I can now duplicate the comp without the randomness changing 🙂