The best place to find this info is in the mel code for the render
globals window
.../maya/scripts/others/createMayaSoftwareCommonGlobalsTab.mel
Here's a snippet of code I wrote in mel a while back accomplishing
what you're asking. I had created a menu option box that was
connected to the defaultRenderGlobals.
...
// Get global variables for mental ray file formats
global string $miImgFormat[];
// If the file format array has not been initialized yet, do so.
if(size( $miImgFormat ) == 0)
miCreateImageFormats();
global string $miImgExtLabel[]; // image extension label
global int $miImgExtNum[]; // numbers corresponding to
defaultRenderGlobals.imageFormat
global string $miMenuItem[]; // UI name for each menu item created
// Get the current image format
string $curImageFormat = `getAttr defaultRenderGlobals.imfkey`;
...
I could go into a more in depth explanation if you need. Or, I could
rewrite this in python. Let me know if this helps
Cheers,
Justin