In addition to the render options in the Render Settings window, you can also set the following render settings using MEL commands.
You can set the render mode by using the following MEL command:
setAttr mentalrayGlobals.renderMode < value >;
You may choose to render only shadow maps or final gather maps when the shadow and final gather information does not change throughout your scene.
For all renders after your final gather render, set Rebuild to Off or Freeze in the Render Settings: mental ray tabs, Indirect Lighting tab, Final Gathering section, Final Gathering Map sub-section.
For all renders after your shadow map render, set the Rebuild Mode to Reuse Existing Maps in the Render Settings: mental ray tabs in the Indirect Lighting tab, Shadows section, Shadow Maps sub-section.
You can set the verbosity level for messages from the translation process. Messages equal to or below the selected severity are displayed in the script editor.
Set the verbosity level using the following MEL command:
setAttr mentalrayGlobals.exportVerbosity < value >;
mental ray installs its own state shader to perform pre- and post-shading operations like sample conversion for rendering with Maya base shaders. Custom state shaders can be chained to perform additional operations.
connectAttr "myStateShader.message" "miDefaultOptions.stateShaderList[index]";
The connected nodes are translated in addition and appended to the standard Maya base state shader (if not disabled) and the potential single state shader node connected to the original stateShader attribute.
Export includes startup file option
The Export includes startup file option has been removed from the File > Export All, Export Selection (mental ray) dialog box. To enable this option, use the following mel script:
optionVar -iv "mentalrayExportStartupFileOption" 1;
With this option enabled, the exported .mi file contains an $include directive for the maya.rayrc startup file that is used by the interactive mental ray renderer in Maya. Use this option to ensure that a consistent configuration is used for rendering both with the mental ray standalone and interactively in Maya.
You can access the framebuffer image caching option through the FrameBuffer Mode option in the mentalrayGlobals node, Extra Attributes section.
Framebuffer caching may save a significant amount of memory when rendering high resolution images. If enabled, only a small fraction of each resulting image is present in memory: newly rendered tiles and tiles recently accessed by the display callbacks, output shaders, writing out final images into files and kernel in some diagnostic modes. To enable framebuffer caching, select this option.