Copy link to clipboard
Copied
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?
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]
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
Copy link to clipboard
Copied
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]
Copy link to clipboard
Copied
Thank you! I have used your expression and I can now duplicate the comp without the randomness changing 🙂
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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