Interface: renderpresets

Interfaces > Core Interfaces > renderpresets

 

   

Core Interfaces - Quick Navigation

This Core Interface provides access to the render presets system introduced in 3ds Max 6.

   

Methods:

<boolean>renderpresets.Save <integer>which <filename>file <bitArray>categories 	 

Save preset to the specified file using the categories described by the bitArray.

Returns true on success.

The integer which specifies the renderer slot to load into:

0 - Production

1 - Material Editor

2 - ActiveShade

NOTE:

Integer values greater than two will cause a System Exception.

   

<boolean>renderpresets.Load <integer>which <filename>file <bitArray>categories   

Load the preset from the specified file, using the categories described by the bitArray.

Returns true on success.

The integer which specifies the renderer slot to load into:

0 - Production

1 - Material Editor

2 - ActiveShade

   

<boolean>renderpresets.SaveAll <integer>which <filename>file 

Save preset to the specified file using all categories.

Returns true on success.

The integer which specifies the renderer slot to load into:

0 - Production

1 - Material Editor

2 - ActiveShade

   

<boolean>renderpresets.LoadAll <integer>which <filename>file 

Load the indexed preset from the specified file, using all categories.

Returns true on success.

The integer which specifies the renderer slot to load into:

0 - Production

1 - Material Editor

2 - ActiveShade

   

<boolean>renderpresets.IsFileCompatible <integer>which <filename>file 

Returns true if the specified file is compatible with the renderer slot specified by the integer which , false otherwise.

The integer which can be one of the following:

0 - Production

1 - Material Editor

2 - ActiveShade

   

<string>renderpresets.MapIndexToCategory <filename>file <integer>index 

Returns a string containing the name of the category corresponding to the specified index in the supplied file. See example further on this page.

   

<integer>renderpresets.MapCategoryToIndex <filename>file <string>category 

Returns the index corresponding to the specified category name in the supplied file.

   

<string>renderpresets.MapSceneIndexToCategory <integer>which <integer>index 

Returns a string containing the name of the category corresponding to the renderer slot specified by the integer which :

0 - Production

1 - Material Editor

2 - ActiveShade

   

<integer>renderpresets.MapSceneCategoryToIndex <integer>which <string>category 

Returns the index slot specified by the integer which :

0 - Production

1 - Material Editor

2 - ActiveShade

   

<bitArray>renderpresets.LoadCategories <filename>file 

Returns the categories available in the specified render presets file as bitArray. Each bit represents a category. See example further on this page.

EXAMPLE

renderPresets.LoadCategories (GetDir #renderPresets +"/mental.ray.no.gi.draft.rps")
#{32..34}

   

<bitArray>renderpresets.SaveCategories <integer>which 

Returns the categories available for the specified renderer as bitArray. The bitArray will have a bit set for each category that can be saved for the specified renderer.

The integer which can be one of the following:

0 - Production

1 - Material Editor

2 - ActiveShade

WARNING!

A side effect of saving and loading the Radiosity presets from the Advanced Lighting tab is that your radiosity solution will be lost.

If you have invested a lot of time in the radiosity solution, it is suggested that you not choose the advanced lighting category when loading a render presets file.

The following script prints all categories from all Render Presets files. It can be used to "peek" into the files to determine which categories are saved in which file, and what category corresponds to which index in the BitArray.

EXAMPLE

(
--Collect all Render Presets files:
theFiles = getFiles (GetDir #renderPresets + "\\*.rps")
--For each Render Presets file,
for f in theFiles do
(
 format "\nRender Preset: %\n" (getFileNameFile f) --Print the file name
 --Get the category indices as BitArray and loop through them,
 --printing the index and the corresponding category name:
 for c in (renderPresets.LoadCategories f) do
  format "%: %\n" c (renderpresets.MapIndexToCategory f c)
)
)

RESULT:

Render Preset: 3dsmax.scanline.no.advanced.lighting.draft.rps
32: Default Scanline Renderer
33: Advanced Lighting
34: Raytracer
 
Render Preset: 3dsmax.scanline.no.advanced.lighting.high.rps
32: Default Scanline Renderer
33: Advanced Lighting
34: Raytracer
 
Render Preset: 3dsmax.scanline.radiosity.draft.rps
3: Environment
32: Default Scanline Renderer
33: Advanced Lighting
34: Raytracer
 
Render Preset: 3dsmax.scanline.radiosity.high.rps
3: Environment
32: Default Scanline Renderer
33: Advanced Lighting
34: Raytracer
 
Render Preset: a.rps
1: Common
4: Render Elements
32: Default Scanline Renderer
33: Advanced Lighting
34: Raytracer
 
Render Preset: b.rps
1: Common
4: Render Elements
32: Default Scanline Renderer
33: Advanced Lighting
34: Raytracer
 
Render Preset: mental.ray.hidden.line.contours.rps
32: mental ray Renderer
33: Processing
 
Render Preset: mental.ray.no.gi.draft.rps
32: mental ray Renderer
33: Processing
34: Indirect Illumination
 
Render Preset: mental.ray.no.gi.high.rps
32: mental ray Renderer
33: Processing
34: Indirect Illumination
OK
OK

Using this information, you can easily load just a single category from a file using MAXScript. In the following example, only category 32 - mental ray Renderer will be loaded, but not the categories 33 and 34 (Processing and Indirect Illumination) that are also stored in the file:

EXAMPLE

renderpresets.Load 0 (GetDir #renderPresets + "\\mental.ray.no.gi.high.rps") #{32}

See Also