Swith Lights off when hidden in a Layer

Hi Guys,
just wondering if there is a script already available (couldnt find any when I checked though).
I do Archviz projects and many times set up separate lights for each camera. However, its very difficult to remember all the lights set up in the scene for a specific camera. Hence was wondering if I could run a script which will switch off all my lights if the layer is hidden in the layer manager.
For example, in Maya, this is the case when you hide the light, the light is off. This way, I just need to hide and unhide the layer when I want to switch them on and off.

Thanks
GP
3DS Max 2010
VRay 1.5 SP4

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Giridhar's picture

Time Log

Hi Guys
could anyone let me know if there is script/plugin to track the time one spent on 3DS Max. What I am actually looking for is to track the time spent on 3DS Max by my guys (working from their residences) on a daily basis - as I plan to reimburse them by the hours.
All of them are modelling artists. Ofcourse if the plugin can identify the idle time, render time etc and show this in the log file, it will be great.

If the plugin can send the logfile directly to the email address on its own, its great but otherwise if it can write to a logfile the details, then still its okay

Best Rgds
gp

miauu's picture

.

You can check the scripts mentoined in this trhead.

But, how you will be sure that your "employees" are working with 3dsMax? If they lieave Max running, the time tracker will tells you that they works, but they may be gone.

Giridhar's picture

Time Log

Hi, Thanks for the link. I downloaded the script and will try this out.

To answer your point on tracking time when the application is not being used, I was hoping the script can distinguish between idle times and work times.

Not sure if it can.

BR

GP

br0t's picture

If you want to have it as a

If you want to have it as a button maybe this would work:

macroscript toggleLightsByLayer
category:"Custom"
(
 
for l in lights do 
(
	if l.layer.on then 
	(
		try 
		(
			l.enabled = true
			l.on = true
		)
		catch()
	)--end if
	else
	(
		try 
		(
			l.enabled = false
			l.on = false
		)
		catch()
	)--end else
)--end for
 
)--end mcr

I guess there are ways to use callbacks and startup scripts to have that stuff happen automatically whenever you change a layer, but maybe thats overkill. You could also have it run the script whenever you hit the render button etc.

Cheers

Never get low & slow & out of ideas

Giridhar's picture

Switch Lights On /Off

Hey,
that was pretty fast and immediate. Let me run this and revert. Thanks much.

Regards,
GP

titane357's picture

and be carefull : if you use

and be carefull : if you use light instances, switching one light "off" make all instances to be "off" even if it is in a visible layer.

titane357's picture

if you use Vray : uncheck

if you use Vray : uncheck "Hidden lights" in global switches

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.