-
Scripting a slider for color control between multiple layers
Hello!
I’m trying to script an common after effects project to be reused for several productions that has multiple elements who’s background changes color depending on the production.
I want to make a slider that anyone can just slide to change the color of all elements easily when the project file is reused.
I have a null layer (named “Color”) with a slider and 13 different color control effects. I’m pulling all this into essential graphics.
Then I add an expression to each fill of each element. However, I’m getting a syntax error in my expression. Can you help me figure out what’s wrong with my expression?
Here’s the fill expression:
slider = Math.floor(thisComp.layer(“<wbr>Color”).effect(“Slider Control”)(“Slider”).value);
if (slider == 1)
effect(“Color Control”)(“Color”)
else if (slider == 2)
effect(“Color Control 2”)(“Color”)
else if (slider == 3)
effect(“Color Control 3”)(“Color”)
else if (slider == 4)
effect(“Color Control 4”)(“Color”)
else if (slider == 5)
effect(“Color Control 5”)(“Color”)
else if (slider == 6)
effect(“Color Control 6”)(“Color”)
else if (slider == 7)
effect(“Color Control 7”)(“Color”)
else if (slider == 8)
effect(“Color Control 8”)(“Color”)
else if (slider == 9)
effect(“Color Control 9”)(“Color”)
else if (slider == 10)
effect(“Color Control 10”)(“Color”)
else if (slider == 11)
effect(“Color Control 11”)(“Color”)
else if (slider == 12)
effect(“Color Control 12”)(“Color”)
else if (slider == 13)
effect(“Color Control 13”)(“Color”)