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…………..