DR lightcache prepass on localhost script

anybody made one already?

i want the lightcache to be rendered on localhost, then stored to a file, then final render with stored solution. because my (slower) render nodes spend all time rendering the lightcache.

that all should be 100% automated.

not quite exactly, but good idea :slight_smile:

Here’s a couple basic snippets for the to file/from file part, shouldn’t be much of a stretch to turn them into callbacks, probably do it later on if you don’t rig something up beforehand.

http://www.buchhofer.com/upload/files/Scripts/applyLightCalc\_filenames.ms
http://www.buchhofer.com/upload/files/Scripts/applyLightCalcFromFile\_filenames.ms

well, here goes, pretty straightforward.., good idea to keep them old athlon beasts somewhat helpful~ :slight_smile:


(
	fn PrecalcLightCache  =
	(
		savePath=(pathConfig.convertPathToUnc (maxfilePath + "\\Calcs\\"))
		--Mode: 0=Single Frame, 1=Fly Thru, 2=From File
		modes=0

		cam = viewport.getcamera()
		lmap = savePath +"\\" +maxfilename + "_" + cam.name + "_lc.vrlmap"
		renderers.current.options_dontRenderImage = true
		renderers.current.gi_primary_type=3 --set primary bounces to LC
		renderers.current.lightcache_autoSave = true
		renderers.current.lightcache_mode = modes
		renderers.current.lightcache_loadFileName = lmap 
		renderers.current.lightcache_saveFileName = lmap 
		renderers.current.lightcache_autoSaveFileName = lmap
	)

	fn LoadLightCache =
	(
		savePath=(pathConfig.convertPathToUnc (maxfilePath + "\\Calcs\\"))
		--Mode: 0=Single Frame, 1=Fly Thru, 2=From File
		modes=2
		cam = viewport.getcamera()
		lmap = savePath + "\\"+maxfilename + "_" + cam.name + "_lc.vrlmap"
		renderers.current.options_dontRenderImage = false
		renderers.current.gi_primary_type=0 --set primary bounces back to irmap
		renderers.current.lightcache_autoSave = false
 		renderers.current.lightcache_mode = modes
		renderers.current.lightcache_loadFileName = lmap 
		renderers.current.lightcache_saveFileName = lmap 
		renderers.current.lightcache_autoSaveFileName = lmap		
	)	

fn singleFrame =
		(
		renderers.current.options_dontRenderImage = false
		renderers.current.adv_irradmap_autoSave = false
		renderers.current.adv_irradmap_mode = 1
		renderers.current.lightcache_autoSave = false
		renderers.current.lightcache_mode = 0
	)	
try(makedir (pathConfig.convertPathToUnc (maxfilePath + "\\Calcs\\")))catch()
renderers.current.system_distributedRender=false
PrecalcLightCache()
max quick render
renderers.current.system_distributedRender=true
LoadLightCache()
max quick render
singleFrame()

)

Brilliant! I think it needs a few notes though: you need to have the ‘calcs’ directory already set up and it needs a camera (for the name obviously).

and that its probably only really useful for people who’s workstations are vastly faster than their render slaves :wink:

edited in the calcs dir thing check/creation, a check for vray and for camera could probably be a good idea

Hi Dave,

that’s great…works like a charm!