Forum Replies Created

  • I have more variables in the calendar that rapidly multiply the number of potential results. Doing this with expressions is much more desirable for my end users.

    I got the code to work. I had write individual if/else statements for the “dropMonth” values. I can’t figure out why it didn’t like the values when separated by commas.

    dropMonth = thisComp.layer(“Master Controller”).effect(“Month”)(“Menu”).value;

    startdayMenu = thisComp.layer(“Master Controller”).effect(“Start Day”)(“Menu”).value;

    date = [31, 30, 29, 28, 27, 26, 25]

    date2 = [“”, 30, 29, 28, 27, 26, 25]

    date3 = [“”, “”, “”, 28, 27, 26, 25]

    date4 = [“”, “”, 29, 28, 27, 26, 25]

    if(dropMonth == 1) {

    date [startdayMenu – 1];

    }else if (dropMonth == 3) {

    date [startdayMenu – 1];

    }else if (dropMonth == 5) {

    date [startdayMenu – 1];

    }else if (dropMonth == 7) {

    date [startdayMenu – 1];

    }else if (dropMonth == 8) {

    date [startdayMenu – 1];

    }else if (dropMonth == 10) {

    date [startdayMenu – 1];

    }else if (dropMonth == 12) {

    date [startdayMenu – 1];

    }else if (dropMonth == 4) {

    date2 [startdayMenu – 1];

    }else if (dropMonth == 6) {

    date2 [startdayMenu – 1];

    }else if (dropMonth == 9) {

    date2 [startdayMenu – 1];

    }else if (dropMonth == 11) {

    date2 [startdayMenu – 1];

    }else if (dropMonth == 2){

    date3 [startdayMenu – 1];

    }else if (dropMonth == 13){

    date4 [startdayMenu – 1];

    }

  • I got my code to work. For some reason, I had to separate the “dropMonth” values into thirteen if/else statements, each one dedicated to a single value. I’m still not sure why the comas in the original code didn’t work. Any ideas?

    dropMonth = thisComp.layer(“Master Controller”).effect(“Month”)(“Menu”).value;

    startdayMenu = thisComp.layer(“Master Controller”).effect(“Start Day”)(“Menu”).value;

    date = [31, 30, 29, 28, 27, 26, 25]

    date2 = [“”, 30, 29, 28, 27, 26, 25]

    date3 = [“”, “”, “”, 28, 27, 26, 25]

    date4 = [“”, “”, 29, 28, 27, 26, 25]

    if(dropMonth == 1) {

    date [startdayMenu – 1];

    }else if (dropMonth == 3) {

    date [startdayMenu – 1];

    }else if (dropMonth == 5) {

    date [startdayMenu – 1];

    }else if (dropMonth == 7) {

    date [startdayMenu – 1];

    }else if (dropMonth == 8) {

    date [startdayMenu – 1];

    }else if (dropMonth == 10) {

    date [startdayMenu – 1];

    }else if (dropMonth == 12) {

    date [startdayMenu – 1];

    }else if (dropMonth == 4) {

    date2 [startdayMenu – 1];

    }else if (dropMonth == 6) {

    date2 [startdayMenu – 1];

    }else if (dropMonth == 9) {

    date2 [startdayMenu – 1];

    }else if (dropMonth == 11) {

    date2 [startdayMenu – 1];

    }else if (dropMonth == 2){

    date3 [startdayMenu – 1];

    }else if (dropMonth == 13){

    date4 [startdayMenu – 1];

    }

  • Thanks, Walter. I’ll check it out.

  • This is a tool for several users. I’m trying to make things as easy as possible.

  • Nicholas Deines

    June 10, 2020 at 5:26 pm in reply to: Shared variables

    Thanks, Andrei! I actually figured that out yesterday after I posted the question.

  • Nicholas Deines

    June 3, 2020 at 4:39 pm in reply to: Multiple if/else expressions for one value

    I was trying to do between 1 and 59. I was trying to figure out how to do that.

  • Nicholas Deines

    June 3, 2020 at 4:05 pm in reply to: Multiple if/else expressions for one value

    Okay, I didn’t know about “else if”. Thanks!

  • Nicholas Deines

    June 2, 2020 at 6:02 pm in reply to: Altering hex color codes with an expression

    Sorry for the delay. Got real busy with work. Thanks for the reply, Scott! Very illuminating.

  • Nicholas Deines

    May 21, 2020 at 3:04 pm in reply to: Altering hex color codes with an expression

    Thanks again for your help, Scott! I think I’ve got it doing what I want. But I want to make sure I understand what I’m doing.

    In the code below, “f” is just a variable that you are defining, right? So I could change that to “l” for “lightness” as long as I multiple hsl[2] by “l”, right?

    Also, when you type ” // lightness factor” is that just a label for yourself to keep things straight?

    c = thisComp.layer(“Color”).effect(“Fill”)(“Color”)
    f = .25; // lightness factor
    hsl = rgbToHsl(c);
    hslToRgb([hsl[0],hsl[1],hsl[2]*f,hsl[3]])

  • Nicholas Deines

    May 20, 2020 at 6:00 pm in reply to: Altering hex color codes with an expression

    Thanks much for the reply, Scott. Do you know if it’s possible to control other like brightness, saturation, and hue?

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