Controlling intensities with script

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  05 May 2007
Controlling intensities with script

How can I create a window that controls the intensity of all the light in the scene no matter how many there are?
  05 May 2007
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.
What The... !@%#

Last edited by Sick Spider : 05 May 2007 at 06:03 AM.
  05 May 2007
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 09:58 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.