Skip to content
Tags

MEL: Setting the color of multiple lights

by nikos on March 12th, 2011

Here’s a snippet for setting the RGB color on multiple lights.

colorEditor;
if (`colorEditor -query -result`) {
    string $lights[] = `ls -sl -dag -type light`;
    float $values[];
    $values = `colorEditor -query -rgb`;

    for ( $l in $lights ) {
        setAttr ($l + ".color") -type double3 $values[0] $values[1] $values[2] ;
   }
}

From → MEL

No comments yet

Leave a Reply

You must be logged in to post a comment.