Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Change the Color of Multiple Layers With Change to Color Effect

  • Change the Color of Multiple Layers With Change to Color Effect

    Posted by Dorian Heller on May 10, 2012 at 8:22 pm

    Hello,

    I am trying to change the value of many shape layers based on one adjustment layer which controls the main colors and a hue/saturation/lightness expression.

    Here’s what I am working with:

    Adjustment layer:
    Color A on Shape layer A is pick whipped to the “Color Control” Effect called “A Color”.

    Then I added a “Change to Color” Effect, where I want to make the global changes to all the shape layers values via Hue, Saturation and Lightness. I am assuming that once I have the expression for Hue, I can copy and paste it to Saturation and Lightness.

    Right now I have the following expression attached to the Change to Color – Hue.

    color = effect(“Change Color (Global)”)(“Hue Transform”)
    change = .2;
    convert = rgbToHsl(color) – [0, 0, 0, change];
    hslToRgb(convert);

    I really want to use expressions to do this effect and am wondering what I am doing wrong. I get the following error:

    After Effects warning: Bad method arguments: argument 1 to rgbToHsl() must be of dimension 4
    Expression disabled.

    What am I doing wrong?
    Thanks in advance.

    -Dorian

    Dorian Heller replied 14 years ago 3 Members · 8 Replies
  • 8 Replies
  • John Cuevas

    May 10, 2012 at 8:49 pm

    I think you need to add another channel there for the alpha, that’s why you are missing a dimension.

    Johnny Cuevas, Editor
    Thinkck.com

    “I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work.”
    —THOMAS EDISON on inventing the light bulb.

  • Dorian Heller

    May 10, 2012 at 8:50 pm

    Okay, thanks! How exactly would I do that?

    Thanks,
    Dorian

  • Cassius Marques

    May 10, 2012 at 9:06 pm

    you’re assigning to the variable “color” a 1 dimension value… and you’re passing that out to “rgbToHsl”

    It should be something like

    convert = rgbToHsl([color,0,0,0]) – [0, 0, 0, change];

    or

    convert = rgbToHsl([something,something,something,color]) – [0, 0, 0, change];

    I’m not sure what should go what to give the desired effect…

    but that’s your error there.

  • Dorian Heller

    May 10, 2012 at 9:09 pm

    Thanks for the idea, unfortunately I’m still getting an error.

    Here it is:

    After Effects warning: Bad method arguments: rgbToHsl() needs exactly 1 argument
    Expression disabled.

    Thanks,
    Dorian

  • Cassius Marques

    May 10, 2012 at 9:25 pm

    It is one argument…are you sure you wrote it right?

    You have to keep the “(” “)”

    Worked here…

  • Dorian Heller

    May 10, 2012 at 9:34 pm

    Cassius,

    You were right, I did forget the quote marks. But now, I am getting a divide by zero error, (arg)! I have changed the values from 0 to 1 and random numeric values but still to no avail:

    color = effect(“Change Color (Global)”)(“Hue Transform”);
    change = 1;
    convert = rgbToHsl(“1,.3,.6,color”) – [1,.2,.4, change];
    hslToRgb(convert);

    Thanks for all your help!
    Dorian

  • Cassius Marques

    May 10, 2012 at 9:41 pm

    I’m sorry if this is confusing…It’s kind of hard to give you the correct simple answer when i’m unsure what you’re going for…

    but you got me wrong… I didn’t mean the quote marks…I meant you have to leave your 4 dimensions [1,2,3,4] inside the parentesis…so it is only one argument…

    I copy and pasted what I wrote you before…and it returned no errors.

    Good luck.

  • Dorian Heller

    May 10, 2012 at 10:39 pm

    Hmmm… That is weird I am trying to get the shape layers Hue to be controlled by one central Hue control, based on expressions. I have the following expression:

    color = effect(“Change Color (Global)”)(“Hue Transform”);
    change = 1;
    convert = rgbToHsl(“1,2,3,4color”) – [.2, 2, 2, change];
    hslToRgb(convert);

    This one is with quotes, and I get the following error:

    After Effects warning: invalid numeric result (divide by zero?)
    Expression disabled.

    Then without quotes and just “color”:

    color = effect(“Change Color (Global)”)(“Hue Transform”)
    change = .2;
    convert = rgbToHsl(color) – [0, 0, change];
    hslToRgb(convert);

    error:

    After Effects warning: Bad method arguments: argument 1 to rgbToHsl() must be of dimension 4
    Expression disabled.

    Then with just numbers:

    color = effect(“Change Color (Global)”)(“Hue Transform”)
    change = .2;
    convert = rgbToHsl(1,2,3,4) – [0, 0, change];
    hslToRgb(convert);

    After Effects warning: Bad method arguments: rgbToHsl() needs exactly 1 argument
    Expression disabled.

    So I do think it needs quotes. But I can’t seem to figure it out..

    Here is the .aep, maybe you could look at it and tell me what I am doing wrong:

    https://dl.dropbox.com/u/17788937/Test%201%20copy.aep

    Once again, thanks for all your help, I really appreciate it.

    Cheers,
    Dorian

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