Mental Ray bake sequence

1. Create shading network with mib_lightmap_write node.
Plug data that you need to bake into INPUT of mib_lightmap_write node.
IMPORTANT: do not create mentalrayTexture via hypershade create bar,
push checker button in texture field of mib_lightmap_write node!!!

2. In render globals common tab enter PRe render Frame MEL script:
string $myFrame = "c:\\Temp\\lightmap" + `currentTime -q` + ".tif";setAttr -type "string" mentalrayTexture1.fileTextureName $myFrame;
3.In render globals set the render mode to "lightmap only" on the features tab.

Render framerange that you need.