Forums › Adobe After Effects Expressions › How use seedrandom and if expressions?
How use seedrandom and if expressions?
Ming Hsu
January 7, 2021 at 3:39 pmi have a composition son include 14 pictures,
and every second i put a photo.
At main composition i write a expression` on “Time Remap”.
i make random picture success,
but I can’t specify the picture.
I use “Slider Control1” control random pics is less than 14,
and is greater than 14 i can use”Slider Control 2″ specify i want pics.
But it doesn’t wok 🙁X = seedRandom(thisComp.layer(“Null 5”).effect(“Slider Control1”)(“Slider”), timeles = 1)
if ( X < 14){
random(1,14)
}else{
thisComp.layer(“Null 5”).effect(“Slider Control 2”)(“Slider”)
}
Dan Ebberts
January 8, 2021 at 9:37 pmI haven’t tested this, but I think it would be more like this:
X = thisComp.layer("Null 5").effect("Slider Control1")("Slider");
if ( X < 14){
seedRandom(X,true);
Math.floor(random(14));
}else{
thisComp.layer("Null 5").effect("Slider Control 2")("Slider")
}
Log in to reply.