<?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 lightmap">
	<melheader s='int $all = 1; string $cam="persp"; int $shadow = 0; int $override = 0; string $tmpSet = `createNode textureBakeSet`; miLoadMayatomr; miCreateDefaultNodes();'/>
	<meltrailer s='lightmapFromCmd($all, $cam, $shadow, $override, $tmpSet);'/>
	<sep/>
	<!-- ______________________________________________________________ -->
	<sep desc="General purpose flags:"/>
	<attrString n="rd" p="1" s='mentalrayGlobals.lightMapPath' t="string" h="Absolute path to the lightmap directory. If not specified, mentalray directory is used."/>
	<mel n="camera" p="1" s='$cam    = "%1"' t="string" h="Camera name."/>
	<mel n="shadow" p="1" s='$shadow = "%1"' t="boolean" h="Enable shadow."/>
	<mel n="all" p="1" s='$all = "%1"' t="boolean" h="Bake all objects in the scene. If 0, bake selected objects."/>
	<mel n="sel" p="1" s='select -add %1;' t="name(s)" h="Selects which objects, groups and/or sets to bake."/>
	<sep/>
	<!-- ______________________________________________________________ -->
	<sep desc="Override texture bakeset settings:"/>
	<mel n="override" p="1" s='$override = %1;' t="boolean" h="Use the following settings and ignore textureBakeset in the scene."/>
	<attr n="colorMode" p="1" s='($tmpSet + ".colorMode")' t="int" h="Color mode:\n\t0 : Light and Color\n\t1 : Only Light\n\t2 : Only Global Illumination\n\t3 : Occlusion\n\t4 : Custom Shader"/>
	<attr n="occlusionRays" p="1" s='($tmpSet + ".occlusionRays")' t="int" h="Number of occlusion rays."/>
	<attr n="occlusionFalloff" p="1" s='($tmpSet + ".occlusionFalloff")' t="float" h="Occlusion falloff."/>
	<attr n="normalDirection" p="1" s='($tmpSet + ".normalDirection")' t="int" h="Normal Direction:\n\t0 : Face Camera\n\t1 : Surface Front\n\t2 : Surface Back"/>
	<attr n="orthogonalReflection" p="1" s='($tmpSet + ".orthogonalReflection")' t="boolean" h="Use surface normal as a reflection direction."/>
	<mel n="customShader" p="1" s='connectAttr ("%1" + ".message") ($tmpSet + ".customShader")' t="string" h="Name of a custom shader to compute lighting. \n\tUsed if colorMode is set to Custom Shader."/>
	<attrString n="prefix" p="1" s='($tmpSet + ".prefix")' t="string" h="Lightmap prefix."/>
	<attr n="xResolution" p="1" s='($tmpSet + ".xResolution")' t="int" h="Lightmap X resolution."/>
	<attr n="yResolution" p="1" s='($tmpSet + ".yResolution")' t="int" h="Lightmap Y resolution."/>
	<attr n="fileFormat" p="1" s='($tmpSet + ".fileFormat")' t="int" h="File format:\n\t1 : tiff\n\t2 : iff\n\t3 : jpg\n\t4 : rgb\n\t5 : rla\n\t6 : tga\n\t7 : bmp"/>
	<attr n="bitsPerChannel" p="1" s='($tmpSet + ".bitsPerChannel")' t="int" h="Number of bytes per channel. 1, 2, or 4."/>
	<attr n="samples" p="1" s='($tmpSet + ".samples")' t="int" h="Number of samples per pixel."/>
	<attr n="bakeToOneMap" p="1" s='($tmpSet + ".bakeToOneMap")' t="boolean" h="Generate one lightmap for all the objects.\n\tMake sure that UV of the objects do not overlap."/>
	<attr n="bakeAlpha" p="1" s='($tmpSet + ".bakeAlpha")' t="boolean" h="Bake alpha channel."/>
	<attr n="alphaMode" p="1" s='($tmpSet + ".alphaMode")' t="int" h="How to compute alpha channel.\n\t0 : Pass Through\n\t1 : Surface Transparency\n\t2 : Luminance of Surface Color\n\t3 : Coverage"/>
	<attr n="finalGatherQuality" p="1" s='($tmpSet + ".finalGatherQuality")' t="float" h="Final gather precompute quality."/>
	<attr n="finalGatherReflect" p="1" s='($tmpSet + ".finalGatherReflect")' t="float" h="Final gather precompute quality for reflection."/>
	<attr n="uvRange" p="1" s='($tmpSet + ".uvRange")' t="int" h="UV range to bake\n\t0 : 0 to 1\n\t1 : Entire Range\n\t2 : User Specified. (uMin uMax vMin vMax)"/>
	<attr n="uMin" p="1" s='($tmpSet + ".uMin")' t="float" h="Min U value for lightmap. Used if uvRange is set to User Specified."/>
	<attr n="uMax" p="1" s='($tmpSet + ".uMax")' t="float" h="Max U value for lightmap. Used if uvRange is set to User Specified."/>
	<attr n="vMin" p="1" s='($tmpSet + ".vMin")' t="float" h="Min V value for lightmap. Used if uvRange is set to User Specified."/>
	<attr n="vMax" p="1" s='($tmpSet + ".vMax")' t="float" h="Max V value for lightmap. Used if uvRange is set to User Specified."/>
	<attr n="overrideUvSet" p="1" s='($tmpSet + ".overrideUvSet")' t="boolean" h="Use specified uv set instead of current uv set."/>
	<attrString n="uvSetName" p="1" s='($tmpSet + ".uvSetName")' t="string" h="Name of UV set to use."/>
	<sep/>
	<!-- ______________________________________________________________ -->
	<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>
