So on a step by step basis I am creating an array using the existing shaders, creating the toon shader for each. Connecting the toon shader output to the color channel of the original shader (this is where I'm stuck)
Hoping to eventually connect the ambientColor output of the original shader to the ramp color inputs of the toon shaders using various percentages of the color to create the light to dark gradient, but haven't gotten anywhere near that far yet.
My code so far:
string $materials[ ] = `ls -sl`; //having selected the original shaders sets up an array
string $i; //a variable for incrementing through the array
for ($i in $materials)
assignToonShader "threeToneBrightness"; //creates the toon shader(this works fine up to here)
connectAttr -f "threeToneBrightnessShader.outColor" "$materials[$i].color";
I'm not sure how to get the connection into the original shader. Have tried several variations on the $materials[$i].color input like just putting the $i or just the $i in brackets. Even tried simplifying it to the point where there's only one item in the array and using "$materials.color" but always get an error. Usually to the effect of cannot find input "whatever I tried here.color".
Anyway, if someone's more familiar than me with scripting shaders I'd appreciate any help. Thanks and all the best.