A little script for Vray

Hi. I wrote a little script, I hope some people will find it useful. It just saves Vray’s Irradiance map and Photon map and gives them Scene’s name. It also places them in a scene’s folder. So, you will always have computed lighting, even if you want to return to some old scene after a while and make a quick rerender.

Attention - before applying script, you have to save your scene (of course if it’s not saved yet).

http://alexcooper.nm.ru/stuff/vray\_maps\_save.zip

Enjoy!

thanks man
great idea
and great script
:wink:

Great Script! I combined it with several others and now have a batch utility that will calculate and save IR maps for all the max files in a folder.

And thanks!

That sounds like a cool one to share arobbert :wink:

and thanks COOP :slight_smile:

I’m a little busy right now with a project, but will post it soon.

I often do projects that require importing a large number of .3ds files into individual scenes to produce images. I needed a way to calculate IR maps and save them so when I open the MAX file it’s ready to go.

This how I created a batch utility to do it:

First I created a script that runs C00PER’s macro and then renders the current view.
In VIZ 4 this script is (omit the parts in [ ]):

macros.run “Cooper” “VrayMapsSave” [runs C00PER’s macro that creates the name and sets it to save the IR]
actionMan.executeAction 0 “50031” [runs quick render to generate the IR map]

To execute the script as a batch on a folder I used a great script called “batcher” by Raymond Stewart available at: http://www.scriptspot.com
This script will run scripts on MAX files in a folder and save the modified files.

Before moving on to the script and batch utility make sure you get C00PER’s macro working manually first.

Using the above scenario is great for processing new scenes created from imported .3ds files, but there are a few things to set correctly. The settings for VRAY should be set in advance for each file. I wanted to use the same settings on all my files so I created a start up file with the right settings, lights, GI etc… before importing the files. It is important that the map dialogs in the advanced irradiance map parameters be as follows:

mode: Single frame
(The from file dialog should be blank)

On render end: don’t delete, autosave, switch to saved map.
(The map in the autosave dialog should be blank [.vrmap])

To calculate new IR maps for files that already have maps created you would remove C00PER’s macro from the script and set the advanced irradiance map parameters as follows:

mode: Single frame
The from file dialog should be blank
On render end: don’t delete, autosave, switch to saved map.
The map in the autosave dialog should be the file name you want to use.

You can then use batcher to calculate all the maps for files in a folder as a batch. Great for calculating those big IR maps while you sleep.

Enjoy…………..

Good stuff lads, VERY usefull.