ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How do I randomly change between six variables every second

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jeremy Krzmarzick
How do I randomly change between six variables every second
on Apr 30, 2020 at 6:19:58 pm



seedRandom(Math.floor(time), timeless = true);
c1=thisComp.layer("Null 1").effect("Color Control")("Color");
c2=thisComp.layer("Null 1").effect("Color Control 2")("Color");
c3=thisComp.layer("Null 1").effect("Color Control 3")("Color");
c4=thisComp.layer("Null 1").effect("Color Control 4")("Color");
c5=thisComp.layer("Null 1").effect("Color Control 5")("Color");
c6=thisComp.layer("Null 1").effect("Color Control 6")("Color");


Return to posts index

Dan Ebberts
Re: How do I randomly change between six variables every second
on Apr 30, 2020 at 6:40:09 pm

Something like this should work:

seedRandom(Math.floor(time), timeless = true);
c1=thisComp.layer("Null 1").effect("Color Control")("Color");
c2=thisComp.layer("Null 1").effect("Color Control 2")("Color");
c3=thisComp.layer("Null 1").effect("Color Control 3")("Color");
c4=thisComp.layer("Null 1").effect("Color Control 4")("Color");
c5=thisComp.layer("Null 1").effect("Color Control 5")("Color");
c6=thisComp.layer("Null 1").effect("Color Control 6")("Color");
idx = Math.floor(random(6))+1;
eval("c" + idx)


Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]