Forum Replies Created

  • Greta Senne

    April 19, 2018 at 2:47 pm in reply to: How to replace one line of code in multiple layers?!

    Thank you very much! I currently have no time today to try out both of your ways – but i cant wait!
    i´ll let you know if i was successfull

  • Greta Senne

    April 7, 2017 at 2:44 pm in reply to: Expression for color control

    same result as before… maybe is added something in the wrong place?

    l=thisComp.layer("Colors");

    // retrieve colors stored in the color controls
    i=1;
    colors=[];

    try {
    while(l.effect(i)) {
    // an effect exists, but is it a color control ?
    // We'll check if it's first parameter is called "Farbe"
    if (l.effect(i)(1).name=="Farbe") {
    colors.push(l.effect(i)(1).value); // store the color in a list
    }
    i++;
    }
    } catch (e) {}

    // Now if the list of colors contains any elements
    // we will get a random value from the list.

    if (colors.length) {
    holdTime = .5;
    seedRandom(index,true);

    preRun = random(holdTime);
    seed = Math.floor((time+preRun)/holdTime);

    seedRandom(seed,true);

    r=Math.floor(random(colors.length)) // a random integer
    colors[r]; // return the color

    } else {
    // the list of colors is empty, so we use the existing color value.
    value;
    }

  • Greta Senne

    April 7, 2017 at 10:06 am in reply to: Expression for color control

    Hey,
    im using your code just added a little time-tweak. I have this Code on an Adjustment Layer because i have multiple layers that i want to change between the colors – but randomly in time. right know everything is changing together.. i hope you understand what i mean.

    i think it could work about the “index”?!

    — thank you —

    here the code again (just added this holdTime-lines)

    l=thisComp.layer("Colors");

    // retrieve colors stored in the color controls
    i=1;
    colors=[];

    try {
    while(l.effect(i)) {
    // an effect exists, but is it a color control ?
    // We'll check if it's first parameter is called "Farbe"
    if (l.effect(i)(1).name=="Farbe") {
    colors.push(l.effect(i)(1).value); // store the color in a list
    }
    i++;
    }
    } catch (e) {}

    // Now if the list of colors contains any elements
    // we will get a random value from the list.

    if (colors.length) {
    holdTime = .5;
    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);

    r=Math.floor(random(colors.length)); // a random integer
    colors[r]; // return the color

    } else {
    // the list of colors is empty, so we use the existing color value.
    value;
    }

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy