![]()
Renderer-specific flags for the command line renderer
For flags specific to one of the integrated Maya renderers, type the following in a shell or Terminal (Mac OS X) window:
where <renderer name> is the name of the renderer (sw, mr, hw, vr).
For example:
which lists the flags for the mental ray for Maya renderer.
The following are tips for command line rendering flags:
- Remember to place a space between option flags and their arguments.
- Any boolean flag will take on the following as true: on, yes, true, or 1; likewise, the following as false: off, no, false, or 0. For example:
Related topics
![]()
![]()
![]()
![]()
Maya Software renderer command line renderer flags
Below are all the flags and their descriptions unique to command line rendering with the Maya Software renderer. You can also type
Render -r sw -helpin a shell or Terminal (Mac OS X) window to see this list.See also Common flags for the command line renderer.
Anti-aliasing flags
Raytracing quality flags
Flag Definition
-ert <boolean>Enable ray tracing.
-rfl <int>Maximum raytracing reflection level.
-rfr <int>Maximum raytracing refraction level.
-sl <int>Maximum raytracing shadow ray depth.
Field options flags
Motion blur flags
Render options flags
Memory and performance flags
Additional render layer flags
Other flags
mental ray for Maya renderer command line renderer flags
Below are all the flags and their descriptions unique to command line rendering with the mental ray for Maya renderer. You can also type
Render -r mr -helpin a shell or Terminal (Mac OS X) window to see this list.See also Common flags for the command line renderer.
Hardware renderer command line renderer flags
Below are all the flags and their descriptions unique to command line rendering with the Hardware renderer. You can also type
Render -r hw -helpin a shell or Terminal (Mac OS X) window to see this list.See also Common flags for the command line renderer.
Quality flags
Render flags
Exporting MI files using the command line
You can use the command line to export your
.mifile to be rendered with a mental ray Standalone renderer. Use this approach for the following purposes:
- Performance. Investing in Standalone licenses allows you to free up Maya for ongoing content creation use. Standalone mental ray is a great way to add supplementary rendering power to a production pipeline.
It also avoids the overhead required for all of Maya when image processing is all you need.
- Flexibility. The
.mifile format is tuned and optimized specifically for rendering pipelines.Use the advanced customization capabilities built into mental ray Standalone for parsing, editing and modifying renderable scene data before and during rendering processes.
Example
Two examples of how to use the command line for exporting
.mifiles is as follows. For more information regarding the export options selected below, see Command Line Flags.Example 1:
Render -r mi -im "cmdrenderTest" -of "gif" -binary 0 -file "C:/temp/test.mi" mayascene.ma
This command creates and exports the mi file C:/temp/test.mi (set by -file flag) in ASCII format (-binary flag). When the test.mi file is rendered with a Standalone renderer, the output image is in gif format (-of flag), with the filename cmdrenderTest (-im flag), and stored in the current directory.
Example 2:
Render -r mi -rd "C:/images" -im "cmdTest" -of "tif" -s 10 -e 15 -b 1 -binary 0 -perframe 0 -exportPathNames "1111111111" -file "C:/temp/test.mi" mayascene.ma
The command above exports frames 10 to 15 (-s, -e, and -b flags), and exports one .mi file for the entire animation (-perframe flag). The exported .mi file is in ASCII format (-binary flag), with the path and filename C:/temp/test.mi. The .mi file uses the absolute path for its full name (-exportPathNames flag).
When the test.mi file is rendered with a Standalone renderer, the output image file is in tif format (-of flag) with the filename cmdTest (-im flag), and stored in the c:/images directory (-rd flag).
Command Line Flags
Below are all the flags and their descriptions unique to exporting
.mifiles using the command line. You can also typeRender -r mi -helpin a command prompt (Windows) or Terminal window (Linux, Mac OS X) to see this list. (Note that theRendercommand is used even though you are exporting a file for rendering with a Standalone renderer.)See also Common flags for the command line renderer.
Export flags
Flag Definition
-file <string>Name of the exported
.mifile. If not specified, the scene name is used.
-binary <boolean>Export
.mifile in binary or ASCII format.0=ASCII
1=binary
-tabstop <int>Tab size to be used in the
.mifile. Use this option to set the number of space characters used to indent lines in your.mifile. This feature improves the readability of your file. For use with.mifiles of ASCII format only.
-perframe <int>Controls per-frame
.mifile export of animations.
- 0: export a single
.mifile containing the whole animation, exploiting incremental changes- 1 or 2 or 3: export one
.mifile per frame not using incremental changes. The.mifilename used for each option varies and is as follows:
- 1: Each
.mifile is named name.mi.#- 2: Each
.mifile is named name.#.mi- 3: Each
.mifile is named name.#Incremental changes are the scene modifications between the first frame and each successive frame of an animation. Mental Ray renders the first frame and keeps this frame, then edits it with the appropriate scene modifications for the next successive frame. These scene modifications are incremental changes.
-padframe <boolean>Set frame number padding (fixed field width) used to generate file name extensions during per-frame export. Padded numbers are frame numbers that have a specified number of digits, where 0s are used to fill the unused digits.
-exportPathNames <string>Specify file path option. Each character in the string specifies the file path option for a different type of file, the order of which is as follows: link library, include
.mifile, texture file, lightmap, light profile, output image, shadow map, final gather map, photon map, demand load object.mifile.The file path options available are:
- 0-no change; 1-absolute; 2-relative; 3-no path, or
- 0-no change; a-absolute; r-relative; n-no path
Example:
-xp aarrararrawill use absolute path for link library, include file, light profile, shadow map, and demand load object.mifile; relative path for texture file, lightmap, output image, final gather map, and photon map.Default: No change.
See Mayatomr for more information.
-fragmentExportEnable fragment export. This option exports the selected nodes with further options to also export the related or connected nodes. Use this option to create an
.mifile that contains only the selected objects or nodes.Default: Export the entire scene.
See Mayatomr for more information.
-fragmentMaterialsUsed in combination with fragment export to also export materials for the shape/transform nodes found in the current selection.
Default: Ignore attached materials.
See Mayatomr for more information.
-fragmentIncomingShdrsUsed in combination with fragment export to also export shading nodes that are connected to nodes found in the current selection (i.e. driving nodes).
Default: Ignore connections.
See Mayatomr for more information.
-fragmentChildDagsUsed in combination with fragment export to also export any child dag of the transform node found in the current selection.
Default: Export only the selected object/instance.
See Mayatomr for more information.
-exportFilter <int>Filters certain types of mental ray entities from the
.mifile using an integer argument. The integer argument is a bitmap where each bit represents a single filter entry. SeeMayatomrfor a list of entities that can be filtered and their corresponding bit value.Default: No filter.
-exportFilterString <string>Filters certain types of mental ray entities from the
.mifile using a string argument. Each character of the string represents a corresponding filter entry. SeeMayatomrfor a list of entities that can be filtered and their corresponding bit value.Default: No filter.
-reg <int int int int>Set sub-region pixel boundary of the final image (left, right, bottom, top).
Related topics
![]()
Generating lightmaps using the command line
The lightmap command uses mental ray lightmap rendering to bake lighting into textures. Use this approach to increase rendering efficiency and save time required for your project. Illumination calculations are expensive and time-consuming. Therefore, if the lighting conditions in your scene do not change, or if you have a particularly complex shading network, you can precompute and store your lightmap in advance so that lighting calculations are not performed at rendering time.
Using the lightmap command, global settings such as output directory, camera name, shadow, objects can be specified. Unless overridden, the texture bake-set assigned to each object is used by default to control color mode, image format etc.
Example
An example of how to use the command line to render a lightmap is as follows. For more information regarding the export options selected below, see Command Line Flags.
Render -r lightmap -rd "C:/output" -sel pSphere1 -sel pSphere2 -override 1 -colorMode 3 -occlusionRays 16The above command bakes both pSphere1 and pSphere2 and saves lightmaps in C:/output.
Command Line Flags
Below are all the flags and their descriptions unique to command line rendering with the lightmap renderer. You can also type
Render -r lightmap -helpin a command prompt (Windows) or Terminal window (Linux, Mac OS X) to see this list.See also Common flags for the command line renderer.
General purpose flags
Texture bake-set setting flags
Flag Definition
-override <boolean>Use the following settings, overriding the texture Bakeset attributes saved in the scene.
-colorMode <int>Color mode option. Specifies the lighting information to be computed.
- 0 : Light and Color. Computes both the incoming light and surface color to produce the final color.
- 1 : Light only. Computes both direct and indirect incoming light.
- 2 : Global Illumination only. Computes global illumination (indirect light) only.
- 3 : Occlusion. Computes grey scale value of the amount of light that reaches a point.
- 4 : Custom Shader. Bakes the specified custom shading network into the bake-set.
Default: 0
See Texture bake set attributes for more information.
-occlusionRays <int>Number of occlusion rays. Increasing the number of occlusion rays improves quality, but reduces performance speed. Used if color mode is set to occlusion.
Default: 64.
See Texture bake set attributes for more information.
-occlusionFalloff <float>Occlusion falloff. Determines the maximum length of an occlusion ray. Rays longer than this value are not considered for occlusion. Used if color mode is set to occlusion.
Default: 0.
See Texture bake set attributes for more information.
-normalDirection <int>Normal Direction.
You may want to adjust the direction of your normals depending on whether you are baking from the outside or the inside of a room. For example, if you are baking from the outside of a room, and you do not wish the lighting in your scene to be affected by the lighting inside the room, then set your normal direction to Surface Back (if your normals are currently pointing inwards the room).
- 0 : Face Camera (towards the camera)
- 1 : Surface Front (outwards from the object surface)
- 2 : Surface Back (inwards from the object surface).
Default: 1.
See Texture bake set attributes for more information.
-orthogonalReflection <boolean>Use surface normal as a reflection direction. Reflection is view dependent because reflection changes depending on viewing angle. It is therefore undesirable to bake the reflection from a particular viewing angle, especially if the lightmap information is used in a camera-fly environment. Using this option, a surface normal rather than an eye ray is used to calculate reflection. The result of the computation is a reflection that is like an environment map. Set to 1 to select this option.
Default: 0.
See Texture bake set attributes for more information.
-customShader <string>Name of a custom shader to compute lighting. Used if colorMode is set to Custom Shader.
See Texture bake set attributes for more information.
-prefix <string>The lightmaps generated by this baking will have names beginning with this prefix.
-xResolution<int>Lightmap X resolution.
-yResolution<int>Lightmap Y resolution.
-fileFormat<int>File format:
- 1 : tiff
- 2 : iff
- 3 : jpg
- 4 : rgb
- 5 : rla
- 6 : tga
- 7 : bmp.
-bitsPerChannel<int>Number of bytes per channel: 1, 2, or 4.
-samples<int>Number of samples per pixel. Increasing the number of samples will improve the accuracy of your rendered result; however, it will also increase the cost of your computation.
-bakeToOneMap<boolean>Generate one lightmap for all the objects. Ensure that UV of the objects do not overlap. Set to 1 to select this option.
Default: 0.
-bakeAlpha<boolean>Include alpha in the resulting texture baking process. Set to 1 to select this option.
Default: 0.
See Texture bake set attributes for more information.
-alphaMode<int>How to compute alpha channel.
- 0 : Pass Through. Leaves alpha channel unaffected. Alpha channel contains the output from the shading network. Use for custom shaders only.
- 1 : Surface Transparency. Alpha channel will contain surface transparency value.
- 2 : Luminance of Surface Color. Alpha channel will contain the luminance of the surface color.
- 3 : Coverage. The alpha channel will store the coverage of the point sampled.
Default: 1.
See Texture bake set attributes for more information.
-finalGatherQuality<float>Final gather precompute quality.
When rendering from the camera, mental ray precomputes a final gather pass before actually rendering the scene. This precomputation pass is disabled by default for baking. You can use this option to perform the same precomputation pass when baking from the command line.
Default: 1.
See Mayatomr for more information on how to set the float argument to obtain the final gather quality that you desire.
-finalGatherReflect<float>Final gather precompute quality for reflection.
Use this option to calculate the reflectivity of your object when precomputing the final gather pass for your lightmap. Use the float argument to set the fraction of final gather points that are precomputed, not on the object being baked, but instead on objects hit by the reflection rays cast from the object being baked.
Default: 0.
See Mayatomr for more information.
-uvRange<int>Bake only specified UV range to lightmap.
- 0 : 0 to 1
- 1 : Entire UV space
- 2 : User specified space range. (uMin uMax vMin vMax).
Default: 0.
-uMin <float>Min U value for lightmap. Used if uvRange is set to User Specified. Only specified UV range is baked to lightmap.
Default: 1.
-uMax <float>Max U value for lightmap. Used if uvRange is set to User Specified. Only specified UV range is baked to lightmap.
Default: 1.
-vMin <float>Min V value for lightmap. Used if uvRange is set to User Specified. Only specified UV range is baked to lightmap.
Default: 1.
-vMax <float>Max V value for lightmap. Used if uvRange is set to User Specified. Only specified UV range is baked to lightmap.
Default: 1.
-overrideUvSet<boolean>Use specified UV set instead of current UV set. Set to 1 to select this option.
Default: 0.
-uvSetName<string>Name of UV set to use.
Related topics
![]()
![]()