Illuminate By Default In Mel Script

Hi,

I am writting a little script to disconnect and reconnect the specular, diffuse and illuminate in the lights
i don't find the good way to write this for the illuminate by default
here is what i wrote :

CODE
string $sel[] = ls -sl;
for( $item in $sel)
{
setAttr ($item+".emitSpecular") 0;
};

but the fonction in the illuminate is more complexe and i don't find the good one

Somebody can help me ?

oh, i want to put all of that in a window, but i only know the simple button fonction
what is the fonction to have a radio button boolean ?

Thanks, Jaz

The way maya does this is slightly long winded, however there is a nice way to do it....

CODE
string $sel[] = ls -sl;
for( $item in $sel)
{
  // fine to set these to 0 or 1
  setAttr ($item+".emitSpecular") 0;
  setAttr ($item+".emitDiffuse") 0;

  // illuminates By Default, essentially connects or disconnects the light from the default light
  // set. The easiest way is to simply edit the object set and remove the light from it
  sets -e -remove "defaultLightSet" $item;
};

CODE
string $sel[] = ls -sl;
for( $item in $sel)
{
  // fine to set these to 0 or 1
  setAttr ($item+".emitSpecular") 1;
  setAttr ($item+".emitDiffuse") 1;

  // add the light into the set...
  sets -e -add "defaultLightSet" $item;
};

QUOTE
oh, i want to put all of that in a window, but i only know the simple button fonction
what is the fonction to have a radio button boolean ?

the checkBox mel command should have a little example a the bottom of the mel docs that should be fairly straightforward. Radiobuttons are a bit annoying in my opinion, and possibly more than you need....

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;

}}