• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

seedRandom expression changes results when duplicating comp

Community Expert ,
Dec 05, 2023 Dec 05, 2023

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?Screenshot 2023-12-05 at 23.32.55.png

TOPICS
Expressions

Views

218

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
community guidelines

correct answers 2 Correct answers

Community Expert , Dec 05, 2023 Dec 05, 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]

 

Votes

Translate

Translate
LEGEND , Dec 06, 2023 Dec 06, 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

Votes

Translate

Translate
Community Expert ,
Dec 05, 2023 Dec 05, 2023

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]

 

Votes

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
community guidelines
Community Expert ,
Dec 05, 2023 Dec 05, 2023

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Community Expert ,
Dec 05, 2023 Dec 05, 2023

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.

Votes

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
community guidelines
LEGEND ,
Dec 06, 2023 Dec 06, 2023

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines