View Full Version : Controlling intensities with script

05 May 2007, 02:41 PM
How can I create a window that controls the intensity of all the light in the scene no matter how many there are?

Sick Spider
05 May 2007, 11:22 PM
Hi, There you go:

global proc wexlerIntLighthUI()
string $win = "intLight";
if (`window -exists $win`) deleteUI -window $win;
window -widthHeight 150 220 -title "Int' Light - Wexler Daniel (" $win;
columnLayout -adjustableColumn 1;
floatSliderGrp -label "int' ?" -cc "wexlerIntLight" -step 0.2 -min 0 -max 5 -field true "howIntLight";
window -e -widthHeight 390 70 $win;

global proc wexlerIntLight()
float $setToWhat = `floatSliderGrp -q -v "howIntLight"`;
string $allLights[] = `ls -type "light"`;
for ($everyLight in $allLights)
setAttr ($everyLight+".intensity") $setToWhat;

The script works with no button, as soon as you change the slider, the Int' of the light will change.
Hope that helps.

CGTalk Moderation
05 May 2007, 11:22 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.