First you need to know the attribute names of everything, in order to set
them. An easy way to dump the attributes visually for you to look at is:

    for a in sorted(cmds.listAttr ('defaultRenderGlobals')):
        print a

You already figured out "imfkey" and could set that via:

    cmds.setAttr ('defaultRenderGlobals.imfkey', "exr", type="string")

Looking through that sorted output of attributes, you will find
"imageFilePrefix". That is the attribute for your File name prefix. You
need to use the setAttr command and also tell it that the value is a string
(the default expects an int)

cmds.setAttr("defaultRenderGlobals.imageFilePrefix", '%c/%s_%l',
type="string")

Now for the other two attributes, they are a different story. They actually
aren't direct attributes of the defaultRenderGlobals. You have to access
them on the mentalrayGlobals.

    for a in sorted(cmds.listAttr ('mentalrayGlobals')):
        print a

We find "imageCompression" and "compressionQuality". The quality is a
simple number:

    cmds.setAttr("mentalrayGlobals.compressionQuality", 10)

But the compression value is not actually a string name. Its an index
number related to the position of the value in the list. This is because
there are different options for different image formats. "zip" is at index
4 (list indexes start at 0), so you can set it by passing the index:

    cmds.setAttr("mentalrayGlobals.imageCompression", 4)

Hope that helps!


On Tue, Jul 17, 2012 at 9:25 AM, Daz <[email protected]> wrote:

> Heya
>
> Im trying to do the exact same thing + set zip as compression and prefix
> to %c/%s_%l... any chance to get some help with it and python? :S I got as
> far as
>
> cmds.getAttr ('defaultRenderGlobals.imfkey')
> # Result: exr #
> // Result:
> scriptEditorPanel1Window|TearOffPane|scriptEditorPanel1|formLayout37|formLayout39|paneLayout1|formLayout40|tabLayout2|formLayout54|cmdScrollFieldExecuter11
> //
>
>  but ehh im green in it ! :(
>
> Thanks for help in advance :)
>
>
>  --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to