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 CLOSED
 
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 (wexlerdaniel.com)"  $win; 
    	columnLayout -adjustableColumn 1;
    	separator;
    	floatSliderGrp -label "int' ?" -cc "wexlerIntLight" -step 0.2 -min 0 -max 5 -field true "howIntLight";
    	separator;
    	window -e -widthHeight 390 70 $win;
    	showWindow;
    }
    
    global proc wexlerIntLight()
    {
    	float $setToWhat = `floatSliderGrp -q -v "howIntLight"`;
    	string $allLights[] = `ls -type "light"`;
    	for ($everyLight in $allLights)
    		setAttr ($everyLight+".intensity") $setToWhat;
    }
    wexlerIntLighthUI;
    


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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 05:40 AM.


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