Render with default lights

Hi there,

 

I am searching for a script that renders with default lights, even if there are lights in the scene.

 

So, the problem is:

Sometimes I am working on a scene where lighting is set up already but I just wanna preview some materials or anything. The Problem in MAX is that as soon as there is a single light created in the scene, the default lights won't render any more even if I turn off all created lights in the scene. So if I wanna render the scene just with defaut lights I have to turn off all lights in the scene, go and create the default lights and render... and turn back everything after rendering.

So it would save a lot of time if there where a script where I can render the scene just with default lights by pressing a button, or having a "on-off-default-lighting"-switch anywhere. So when the switch is turned on, all lights in the scene should be turned off before rendering and the default light are temporarily created for rendering. And then, of course, after rendering, everything should be set back as before.

 

Is that possible? Maybe there already exists a similar script anywhere??

 

Would be nice to get some response :)

 

Greetz Ben

 

 

EDIT: Here is link to where the same problem is done "by hand". If this process could be accomplish with a script that would be really helpful. Also if there was an option to render with the "one-default-light-setup" that would be great, since you can only create default lights when the default-lighting-setup is set to two lights... hope you get Iwhat I mean... :)

http://3dsmaxrendering.blogspot.com/2008/10/testing-materials-with-default.html

Comments

Comment viewing options

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

Hey Wobi, you spend lots

Hey Wobi, you spend lots time to describe exactly what you want... Did you ever tried to write something yourself? Seriously? If you stick with something, you always can receive help here by posting your code.

Regards, Anubis

my recent MAXScripts RSS (archive here)

wobi's picture

Hey thanks guys, Sry I did

Hey thanks guys,

Sry I did not write earlier. These are nice scripts... BUT:

 

This isn't really what I need since these methods depend on the two default lights beeing created BEFORE the script!

1. I don't want to have to create the default lights prior to running the script (should be temporary created by the script and deleted after rendering has finished)

2. I don't want to use the "2-Default-Light"-Setup but the standard "1-Default-Light"-Setup (which cannot be created by the user as with the 2-default-lights setup)

3. The light should be placed with regard to the actual camera position (as the single default light does).

 

Just to clear things up:

 

1. Open a new scene. (Be sure to have single-default-light-setup)

2. Create a teapot.

3. Press render. (See only the single default light coming from somewhat above the camera...)

 

4. Rotate and/or move the camera.

5. Press render. --> Now you notice that the default-single-light changed position according to the camera! Lighting the object always from the same angle<--

6. Now create a light.

After this first light is created, I never ever again can render like before without having any light in the scene. Know what I mean?

 

So, the script should (by itself) create a temporary light with position according to the actual camera position (like the default light does... probably a 45-degree position above the camera...). Then, before rendering, turn all other lights off and after rendering turn them back on again and delete the temporary light.

 

See what I mean?

 

But again, thanks for your effort, I really appreciate your ideas.... but it would be soooo cool (for me) if this could work the way I described above ^^

 

Till then

Greetz Ben

 

PS: That the scripts turns off Final Gather, Photons and all that stuff is just perfect *thumbs up*

Poker's picture

cool, didnt know about that

cool, didnt know about that feature:-)

Anubis's picture

Hmm, this must be more easy

Hmm, this must be more easy task if assign Pre-Render and Post-Render scripts, and this way can easy turn on/off script at any time. All that need to do is to save 2 super short scripts (in separate files):

-- PRE-Render script
lights.enabled=off
#($DefaultFillLight,$DefaultKeyLight).enabled=on
-- POST-Render script
lights.enabled=on
#($DefaultFillLight,$DefaultKeyLight).enabled=off

MaxDefLigthSwith

my recent MAXScripts RSS (archive here)

Poker's picture

updated the script to

updated the script to include finalgather, caustics and global illumination.

(
rollout rollout_DefaultLights "Default Lights Switch"
(
button DefaultOn "Default Lights On"
button DefaultOff "Default Lights Off"
checkbox Finalgather "Involve Final Gather"
checkbox Caustic "Involve Caustics"
checkbox GlobalIllum "Involve Global Illumination"
 
on DefaultOn pressed do
(
local NonDefault = for o in lights where o != $DefaultKeyLight and o != $DefaultFillLight collect o
local Default = #($DefaultFillLight,$DefaultKeyLight) as array
 
for o in Nondefault do o.enabled = off
for o in Nondefault do try(o.on = false) catch()
for o in Default do o.enabled = on
 
if Finalgather.checked == true do renderers.current.FinalGatherEnable2 = false
if Caustic.checked == true do renderers.current.CausticsEnable = false
if GlobalIllum.checked == true do renderers.current.GlobalIllumEnable = false
)
on DefaultOff pressed do
(
local NonDefault = for o in lights where o != $DefaultKeyLight and o != $DefaultFillLight collect o
local Default = #($DefaultFillLight,$DefaultKeyLight) as array
 
for o in Nondefault do o.enabled = on
for o in Nondefault do try(o.on = true) catch()
for o in Default do o.enabled = off
 
if Finalgather.checked == true do renderers.current.FinalGatherEnable2 = true
if Caustic.checked == true do renderers.current.CausticsEnable = true
if GlobalIllum.checked == true do renderers.current.GlobalIllumEnable = true
)
)
createdialog rollout_DefaultLights style:#(#style_titlebar,#Style_toolwindow,#style_sysmenu)
)

is it any good??

Poker's picture

how about this

how about this script??

(
 
	rollout rollout_DefaultLights "Default Lights Switch"
	(
		button DefaultOn "Default Lights On"
		button DefaultOff "Default Lights Off"
 
		on DefaultOn pressed do
		(
			local NonDefault = for o in lights where o != $DefaultKeyLight and o != $DefaultFillLight collect o
			local Default = #($DefaultFillLight,$DefaultKeyLight) as array
 
			for o in Nondefault do o.enabled = off
			for o in Default do o.enabled = on
		)
		on DefaultOff pressed do
		(
			local NonDefault = for o in lights where o != $DefaultKeyLight and o != $DefaultFillLight collect o
			local Default = #($DefaultFillLight,$DefaultKeyLight) as array
 
			for o in Nondefault do o.enabled = on
			for o in Default do o.enabled = off
		)
	)
createdialog rollout_DefaultLights style:#(#style_titlebar,#Style_toolwindow,#style_sysmenu)
)

run the script and a dialog will come up. its dependent on the default lights being named "DefaultFillLight" and "DefaultKeyLight"

Comment viewing options

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