Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Switching Effects on & off by a Checkbox controller

  • Paul Roper

    November 5, 2013 at 2:19 pm

    And if you also want a shade controller (I’m guessing it’s to control the lightness of the colour) you could simply add a slider whose values go from 1 to 6, call it “Lightness” and add a bit to the end of the script:

    Change the .1 and the 1 in the “linear” statement to reflect how bright/dark you want it. The “.value.toFixed(0)” ensures that only 6 levels of brightness can be selected, by rounding the value to 0 decimal places.

    idx=0;
    if (effect("reddish")("Checkbox") ==1) { idx = 1};
    if (effect("dark orange")("Checkbox") ==1) { idx = 2};
    if (effect("light orange")("Checkbox") ==1) { idx = 3};
    if (effect("yellow")("Checkbox") ==1) { idx = 4};
    if (effect("pale yellow")("Checkbox") ==1) { idx = 5};

    colors = [[255,255,255],
    [179,32,52],
    [232,73,27],
    [239,125,0],
    [252,192,67],
    [255,229,150]];
    c = colors[idx]/255;

    lightness=effect("Lightness")("Slider").value.toFixed(0);
    lightnessMultiplier= linear(lightness,1,6,.1,1);
    [c[0],c[1],c[2],1]*lightnessMultiplier

  • John Pritchett

    November 12, 2013 at 9:19 pm

    OK Dan. Ive been working on this script now for a few days with no luck.
    Is there any chance I can send you my AE project file? This may give you a better idea of what I am trying to achieve.
    Many Thanks

  • Dan Ebberts

    November 13, 2013 at 7:25 pm

    If you want to do that, I’ll take a look at it. I’ve got a couple of big projects going, so I won’t have a lot of time to fiddle with it.

    Dan

  • John Pritchett

    November 18, 2013 at 3:55 am

    Hi Dan,
    Sorry for the slow reply. I have been on and off this job.
    It would be great if you could help me out. There is no urgent rush.
    How to I get you the job file?
    Thanks

Page 2 of 2

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