« Save Our Soho | Home | Oscar In Da House »

MEL: Setting the color for multiple lights

By nikos | May 16, 2008

Here’s a snippet if you want to set the RGB color for multiple lights at once.

colorEditor;
  1. if (`colorEditor -query -result`) {
  2.     string $lights[] = `ls -sl -dag -type light`;
  3.     float $values[];
  4.     $values = `colorEditor -query -rgb`;
  5.  
  6.     for ( $l in $lights ) {
  7.         setAttr ($l + ".color") -type double3 $values[0] $values[1] $values[2] ;
  8.    }
  9. }

Topics: Maya | No Comments »

Comments are closed.