Export a .mi file and render with mental ray

There are two ways to export a .mi file for rendering with mental ray. The first method is to use the File > Export All option. The second method is to use the mi exporter from the command line.

To export a .mi file and render with mental ray using File > Export All

  1. Select File > Export All > .

    The Export All Options window appears.

  2. Select mentalRay as the file type.

    There are File Type Specific Options in the Export All Options window you can use to control file naming schemes and other details.

  3. Click Export All.
    Tip:

    You can use the key to cancel a mental ray for Maya export operation. This functionality cancels the export operation, but Maya remains running.

To export a .mi file using the command line

  1. Use the -r mi flag. See Command Line Flags for more information. For example:
    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).

Scene Export Optimization Controls using dynamic attributes

Several controls let you manually optimize the process of exporting scenes to .mi format. The translator recognizes a specific set of dynamic attributes that you can add to nodes to control how they are exported.

To export a .mi file, see Export a .mi file and render with mental ray.

You can accelerate the process of exporting scenes to .mi format by disabling deformation checking for objects that are known to be static over an animation (buildings, for example), and by disabling tangent vector export for objects that do not use bump mapping or other tangent-based shading effects.

miDeformation

Controls whether or not the translator tries to detect deformation of an object.

To support per-object control of deformation determination and motion vector calculation of shape nodes, this dynamic attribute of type boolean is recognized. It overrides the global Export Shape Deformation option and either marks the current shape for or excludes it from deformation motion blur. Two common scenarios are supported:

This option may accelerate translation of shape animations and detection of deformation motion blur dramatically.

miTangents

Controls export of tangent vectors on objects.

To support per-object control of tangent vector calculation for polygon meshes and NURBS surfaces, this dynamic attribute of type boolean is recognized. It overrides the global Export ... Derivatives options and marks or ignores the current shape accordingly for tangents computation. Two common scenarios are supported:

The tangents are first order derivatives supplied as mental ray bump basis vectors. They are required for mayabase shader filtering and bump mapping purposes.

Related Topics: