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

SeedRandom expression, how to stop it? from Dan Ebbert's tutorial

New Here ,
May 15, 2025 May 15, 2025

Hi,

 

I'm applying Dan Ebbert's values from his tutorial to use SeedRandom here below.
I applied it to an amount of dots forming a letter.
The random movement of each dot is perfect, but I want to control time and make it stop to the initial position (letter formed by dots).
Also interested to start from the letter formed, to a SeedRandom movement, than back to initial position.

Any clues to get it?

Thanks a lot for your help

segMin = .3; //minimum segment duration
segMax = .7; //maximum segment duration
minVal = 0;
maxVal = thisComp.width;

end = 0;
j = 0;
while ( time >= end){
  j += 1;
  seedRandom(j,true);
  start = end;
  end += random(segMin,segMax);
}
endVal =  random(minVal,maxVal);
seedRandom(j-1,true);
dummy=random(); //this is a throw-away value
startVal =  random(minVal,maxVal);
y = position[1];
ease(time,start,end,[startVal,y],[endVal,y])
 

 

TOPICS
Expressions
317
Translate
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 1 Correct answer

Community Expert , May 15, 2025 May 15, 2025

I think this version will do it. It has a new variable, totalDur, after which the animation will settle back to the original value:

segMin = .3; //minimum segment duration
segMax = .7; //maximum segment duration
minVal = 0;
maxVal = thisComp.width;
totalDur = 5; // length of animation

start = end = 0;
j = 0;
prevTarget = target = value[0];
while (time >= end){
  prevTarget = target;
  seedRandom(j,true);
  target = random(minVal,maxVal);
  start = end;
  end += random(segMin,segMax);
  if (end 
...
Translate
Community Expert ,
May 15, 2025 May 15, 2025

I think this version will do it. It has a new variable, totalDur, after which the animation will settle back to the original value:

segMin = .3; //minimum segment duration
segMax = .7; //maximum segment duration
minVal = 0;
maxVal = thisComp.width;
totalDur = 5; // length of animation

start = end = 0;
j = 0;
prevTarget = target = value[0];
while (time >= end){
  prevTarget = target;
  seedRandom(j,true);
  target = random(minVal,maxVal);
  start = end;
  end += random(segMin,segMax);
  if (end > totalDur) target = value[0];
  j++;
}
y = value[1];
ease(time,start,end,[prevTarget,y],[target,y]);

 

Translate
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
New Here ,
May 16, 2025 May 16, 2025
LATEST

Oh !

 

Thank you so much.
It works fine.
I'm gonna try to play with values.

Thanks a lot

Translate
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