Forum Replies Created

Page 1 of 2
  • Clement Dubois

    March 1, 2022 at 5:37 am in reply to: Copy-paste goes wrong

    Could I use clamp() ? I tried but it not worked.

    🤔

  • Clement Dubois

    February 25, 2022 at 6:30 pm in reply to: Random value each keyframe

    Thanks again Dan !

  • Clement Dubois

    February 24, 2022 at 8:39 pm in reply to: Random value each keyframe

    Hi !

    I am still working on the project and I’m having issues with the code.

    As you said, the fact that we use random() don’t always generate a different color than the previous one. And it is the case on my project, I tried to “cheat” by adding keyframes and it worked BUT for the rest of my project I have to do it without “cheating” otherwise everything will be broken 😅.

    Have you any idea how to do it ? I guess it would be a whole different code

    Thanks in advance, Clément.

  • Clement Dubois

    February 12, 2022 at 5:23 pm in reply to: Random value each keyframe

    Again, thank you Filip !

    Here’s my code !

    c = thisComp.layer("Shape layer 1").content("Rectangle 1").content("Fill 1").color;
    yellow = [0.9961, 0.8941, 0.251, 1];
    purple = [0.498, 0.2902, 0.8, 1];
    //colors
    if (length(c, yellow)<0.001){
    purple
    }else{
    yellow
    }
  • Clement Dubois

    February 12, 2022 at 9:25 am in reply to: Random value each keyframe

    EDIT :

    While we are on the color subject, I wondering how can I compare colors to each others.

    For exemple I tried this code :

    EDIT :

    c = thisComp.layer("Shape layer 1").content("Rectangle 1").content("Fill 1").color;
    purple = [0.498, 0.2902, 0.8, 1];
    yellow = [0.9961, 0.8941, 0.251, 1];
    if (c[0] == 0.489 && c[1] == 0.2902 && c[2] == 0.8 && c[3] == 1){
    [0.9961, 0.8941, 0.251, 1]
    }else{
    [0.498, 0.2902, 0.8, 1]
    }

    The color don’t change I tried to apply RgbToHsl() but I surely did it wrong.

  • Clement Dubois

    February 12, 2022 at 8:34 am in reply to: Random value each keyframe

    It is pure magic !

    This blow my mind ! It work as I wanted !

    Thanks you Filip and Tomas for your help ! 🤓

  • Clement Dubois

    February 10, 2022 at 11:58 am in reply to: Random value each keyframe

    Hi Tomas,

    To be more specific, I have 5 colors that I want to be random on music beat.

    The problem is that the random() expression do it every frame, and the music will be changed in the project, that is is why I thoughts about keyframes, wich I could easily edit on the beat.

  • Thanks Filip ! After few tweaks I found this code and it worked fine !

    b = thisComp.layer("Null 1").effect("Angle Control")("Angle");
    a=degreesToRadians(b);
    pos = [Math.cos(a) , Math.sin(a)];
  • Hi Filip,

    Yes the image is missing…

    <div>I think it is the kind of code I am looking for, maybe the image will help you.</div>

  • Hi, thank you, Andrei and Dan for your replies.

    I tried what you sent, and the second expression of Andrei work fine !

Page 1 of 2

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