<?xml version="1.0"?>
<!DOCTYPE renderer SYSTEM "renderer.dtd">
<!--
  Top level tag, mandatory:
    <renderer>: "desc" gives a one line description.

  Header tags, not mandatory, must be specified only once.
    <melheader>: "s" is a mel script executed just after the file is read 
    <meltrailer>: "s" is a mel script executed after all flags are converted
        to mel. Should contain at least the rendering command.

  Other tags:
    <sep>: "desc" produces a line in the help. Blank if desc is missing.
    <attr>: produces a setAttr line.
        "n" is the flag name.
        "s" the attribute name.
        "t" the parameter type, used in help description.
        "h" the help description.
    <attrString>: produces a setAttr line for a string attribute.
        Same parameters as <attr>, but for string attributes.
    <mel>: Calls a mel script.
        "n" is the flag name.
        "p" the number of parameters.
        "s" the string defining the action %1 ... %p are replaced with values
                read after the flag.
        "t" the parameter types, used in help description.
        "h" the help description.
-->
<renderer desc="Mentalray Exporter">
	<melheader s='string $filename=""; string $rl=""; string $rp=""; string $opt=""; float $resize=-1.; miLoadMayatomr; miCreateDefaultNodes(); select defaultRenderGlobals; setAttr .renderAll 1'/>
	<meltrailer s='setMayaSoftwareLayers($rl, $rp); miCreateMentalJobs(); setImageSizePercent($resize); mentalrayBatchExportProcedure($filename, $opt); '/>
	<sep/>
	<!-- ______________________________________________________________ -->
	<sep desc="General purpose flags:"/>
	<mel n="rd" p="1" s='workspace -rt "images" "%1";workspace -rt "depth" "%1";' t="path" h="Directory in which to store image files"/>
	<attrString n="im" s=".imageFilePrefix" t="filename" h="Image file output name"/>
	<mel n="of" s='setMentalRayImageFormat("%1")' p="1" t="string" h="Output image file format. See the Render Settings window\n\tto find available formats"/>
	<sep/>
	<!-- ______________________________________________________________ -->
	<sep desc="Frame numbering options"/>
	<mel n="s" p="1" t="float" s="removeRenderLayerAdjustmentAndUnlock .animation; setAttr .animation 1; removeRenderLayerAdjustmentAndUnlock .startFrame; setAttr .startFrame %1" h="Starting frame for an animation sequence"/>
	<mel n="e" p="1" t="float" s="removeRenderLayerAdjustmentAndUnlock .animation; setAttr .animation 1; removeRenderLayerAdjustmentAndUnlock .endFrame; setAttr .endFrame %1" h="End frame for an animation sequence"/>
	<attr n="b" s=".byFrameStep" t="float" h="By frame (or step) for an animation sequence"/>
	<attr n="pad" s=".extensionPadding" t="int" h="Number of digits in the output image frame file name\n\textension"/>
	<mel n="rfs" p="1" t="int" s="removeRenderLayerAdjustmentAndUnlock .modifyExtension; setAttr .modifyExtension 1; removeRenderLayerAdjustmentAndUnlock .startExtension; setAttr .startExtension %1" h="Renumber Frame Start: number for the first image when\n\trenumbering frames"/>
	<attr n="rfb" s=".byExtension" t="int" h="Renumber Frame By (or step) used for renumbering frames"/>
	<mel n="fnc" s='setMayaSoftwareFrameExt("%1", 1)' p="1" t="int" h="File Name Convention: any of name, name.ext, ... See the\n\tRender Settings window to find available options. Use namec and\n\tnamec.ext for Multi Frame Concatenated formats. As a shortcut,\n\tnumbers 1, 2, ... can also be used"/>
	<sep/>
	<!-- ______________________________________________________________ -->
	<sep desc="Camera options"/>
	<mel n="cam" s='makeCameraRenderable("%1")' p="1" t="name" h="Specify which camera to be rendered"/>
	<mel n="rgb" s='applyOnCameras("image", "%1")' p="1" t="boolean" h="Turn RGB output on or off"/>
	<mel n="alpha" s='applyOnCameras("mask", "%1")' p="1" t="boolean" h="Turn Alpha output on or off"/>
	<mel n="depth" s='applyOnCameras("depth", "%1")' p="1" t="boolean" h="Turn Depth output on or off"/>
	<sep/>
	<!-- ______________________________________________________________ -->
	<sep desc="Resolution options"/>
	<attr n="x" s="defaultResolution.width" t="int" h="Set X resolution of the final image"/>
	<attr n="y" s="defaultResolution.height" t="int" h="Set Y resolution of the final image"/>
	<mel n="percentRes" s="$resize=%1" p="1" t="float" h="Renders the image using percent of the resolution"/>
	<attr n="ard" s="defaultResolution.deviceAspectRatio" t="float" h="Device aspect ratio for the rendered image"/>
	<sep/>
	<!-- ______________________________________________________________ -->
	<sep desc="Render Layers and Passes:"/>
	<mel n="rl" s='$rl="%1"' p="1" t="boolean|name(s)" h="Export specified render layer only"/>
	<mel n="rp" s='$rp="%1"' p="1" t="boolean|name(s)" h="Export specified render passes. 'all' will export all passes"/>
	<mel n="sel" p="1" s="select -add %1; setAttr defaultRenderGlobals.renderAll 0" t="boolean|name(s)" h="Selects which objects, groups and/or sets to render"/>
	<sep/>
	<!-- ______________________________________________________________ -->
	<sep desc="Export:"/>
	<mel n="file" s='$filename = "%1"' p="1" t="string" h="Name of the exported mi file. If not specified, the scene name is used"/>
	<mel n="binary" s='if(%1) $opt +=" -binary "' p="1" t="boolean" h="Export mi file in binary or ascii format"/>
	<mel n="tabstop" s='$opt +=" -tabstop %1"' p="1" t="int" h="Tab size to be used in the mi file"/>
	<mel n="perframe" s='$opt +=" -perframe %1"' p="1" t="int" h="Controls per-frame .mi file export of animations. 
	\n\t0 : single .mi file containing the whole animation, exploiting incremental changes.
	\n\t1:export one .mi file per frame not using incremental changes. Each mi file is named name.ext.#
	\n\t2:export one .mi file per frame not using incremental changes. Each mi file is named name.#.ext
	\n\t3:export one .mi file per frame not using incremental changes. Each mi file is named name.#"/>
	<mel n="padframe" s='$opt +=" -padframe %1"' p="1" t="boolean" h="Set frame number padding (fixed field width) used to generate file name extensions during per-frame export"/>
	<mel n="exportPathNames" s='$opt +=" -exportPathNames \"%1\""' p="1" t="string" h="Specify file path option. See Mayatomr mel documentation for more info."/>
	<mel n="fragmentExport" s='$opt +=" -fragmentExport "' p="0" h="Enable fragment export. See Mayatomr mel documentation for more info"/>
	<mel n="fragmentMaterials" s='$opt +=" -fragmentMaterials "' p="0" h="In fragment export, translate materials for the shape/transform nodes. See Mayatomr mel documentation for more info"/>
	<mel n="fragmentIncomingShdrs" s='$opt +=" -fragmentIncomingShdrs "' p="0" h="In fragment export, translate shading ndoes connected to the shape/transform nodes. See Mayatomr mel documentation for more info"/>
	<mel n="fragmentChildDag" s='$opt +=" -fragmentChildDag "' p="0" h="In fragment export, translate any child dag of the transform node. See Mayatomr mel documentation for more info"/>
	<mel n="exportFilter" s='$opt +=" -exportFilter %1"' p="1" t="int" h="Filters certain types of mental ray entities from the mi file. See Mayatomr mel documentation for more info"/>
	<mel n="exportFilterString" s='$opt +=" -exportFilterString %1"' p="1" t="string" h="Set the export filter using string argument. See Mayatomr mel documentation for more info"/> 
	<sep/>
	<!-- ______________________________________________________________ -->
	<sep desc="Mel callbacks"/>
	<attrString n="preRender" s=".preMel" t="string" h="Mel code executed before rendering"/>
	<attrString n="postRender" s=".postMel" t="string" h="Mel code executed after rendering"/>
	<attrString n="preLayer" s=".preRenderLayerMel" t="string" h="Mel code executed before each render layer"/>
	<attrString n="postLayer" s=".postRenderLayerMel" t="string" h="Mel code executed after each render layer"/>
	<attrString n="preFrame" s=".preRenderMel" t="string" h="Mel code executed before each frame"/>
	<attrString n="postFrame" s=".postRenderMel" t="string" h="Mel code executed after each frame"/>
	<mel n="pre" s='print("WARNING: flag -pre is obsolete. Use -preRender, -preLayer, -preFrame\n");' p="1" t="string" h="Obsolete flag"/>
	<mel n="post" s='print("WARNING: flag -post is obsolete. Use -postRender, -postLayer, -postFrame\n");' p="1" t="string" h="Obsolete flag"/>
	<sep/>
	<!-- ______________________________________________________________ -->
	<sep desc="Other:"/>
	<mel n="reg" s="setMentalRayRenderRegion(%1,%2,%3,%4)" t="int int int int" p="4" h="Set sub-region pixel boundary of the final image:\n\tleft, right, bottom, top"/>
	<!-- ______________________________________________________________ -->
	<sep desc=" *** Remember to place a space between option flags and their arguments. ***"/>
	<sep desc="Any boolean flag will take the following values as TRUE: on, yes, true, or 1."/>
	<sep desc="Any boolean flag will take the following values as FALSE: off, no, false, or 0."/>
	<sep/>
	<sep desc="    e.g. -s 1 -e 10 -x 512 -y 512 -cam persp -of jpg file."/>
</renderer>
