Awesome, getAttr defaultRenderGlobals.imfkey is exactly what I needed. No
need for the python rewrite had just never encountered the imfkey attribute.
=P Thanks a ton!

On Tue, Jun 30, 2009 at 12:50 AM, Justin Rosen <[email protected]>wrote:

>
> 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
>
> On Jun 26, 2009, at 11:36 AM, [email protected] wrote:
>
> >
> > Happy Friday everyone!
> >
> > I'm hoping I'm just completely missing the mark here. I'm reworking
> > some auto-scene setup scripts for my artists and for the current job
> > we're using mostly mentalray instead of renderman. I need to switch
> > the image format to EXR.
> >
> > The image formats translate to numerical values:
> > mentalrayFormats = {'pic':1, 'rla':2, 'tif':3, 'rgb':5, 'als':6,
> > 'jpg':
> > 8, 'eps':9,
> >                               'yuv':12, 'tga':19, 'bmp':20, 'psd':31,
> 'png':32}
> >
> > mc.setAttr( 'defaultRenderGlobals.imageFormat', 3 ) #if I wanted to
> > switch to tif
> >
> > Other than the formats in the dict above, all other formats are value
> > of 51... how do I switch to exr via python if all the other formats
> > default to 51? Is there another way to change this setting? Thanks
> > folks.
> > >
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to