Thanks a lot, it helps me a lot.
Here is the script i wrote with (a window where you can choose to add or remove illuminate, specular and diffuse)
there a little unused argument but who don't trouble anything, i just didn't know how to write exacly.
It works perfectly with no error message so... that the most imortant.
thanks again
CODE
window -title "Add&Remove light radio" -rtf true thelightsWin;
rowColumnLayout -numberOfColumns 4;
string $t = text -l "Remove Chanels :";
button -label "Illuminate" -c "offIllum remove" killI;
button -label "Diffuse" -c "attRemover emitDiffuse" killD;
button -label "Specular" -c "attRemover emitSpecular" killS;
string $t = text -l "Calling Chanels :";
button -label "Illuminate" -c "addIllum add" backI;
button -label "Diffuse" -c "attCalling emitDiffuse" backD;
button -label "Specular" -c "attCalling emitSpecular" backS;
showWindow thelightsWin;
proc attRemover( string $theLight ) {
string $theSelection[] = ls -sl;
for ($theNode in $theSelection){
setAttr ($theNode + "."+$theLight) 0;
}}
proc attCalling( string $theLight ) {
string $theSelection[] = ls -sl;
for ($theNode in $theSelection){
setAttr ($theNode + "."+$theLight) 1;
}}
proc offIllum( string $theLight ) {
string $theSelection[] = ls -sl;
for ($theNode in $theSelection){
sets -e -remove "defaultLightSet" $theNode;
}}
proc addIllum( string $theLight ) {
string $theSelection[] = ls -sl;
for ($theNode in $theSelection){
sets -e -add "defaultLightSet" $theNode;
}}