[Maya 2016] Mental Ray Attributes access

Hello,

I am trying to access to specific attributes from Mental Ray…
Already editing many from miDefaultOptions but no way to find the following…

Below a picture to be more clear, because it seems those settings always change of location on EVERY version of maya (seriously… yes… =_=#)

1 - Force “Render Using” to Mental Ray.

2 & 3 - Color Management > force True and sRGBGamma
Already found and edited from script the “defaultViewColorManager” node but it doesn’t really do much and a bit confusing from user interface…
Actually that is so confusing that there are so many Color Management settings available (Viewport render, Render output, Outliner node…)

4 - Image Format
Well if already set as IFF, using the Mayatomr to render the pic then using imgcvtto convert to PNG is easy.
But if the picture is not set as IFF from the Settings it doesn’t output anything… and default format is always set to OpenEXR(exr)…

5 - Image Size (Width and Height)
One more time with Mayatomr, output is correct (using a square 256x256px dimension).
But the default value from the render settings is 960x540px then the result is always stretched on the square output… (WTF I would say…)

6 - Motion Blur
Already have an access to the Motion Blur type, and value with those 2 attributes :

  • miDefaultOptions.motionBlur
  • miDefaultOptions.motionBlurBy
    … but where is the KeyFrameLocation one?? Really need to set it to “Start of frame” (it is “Middle of frame” by default)

I will keep searching & testing and we’ll update the thread if I find it first!

Thanks you so much by advance guys! ^__^!\

Found the 3 following ones :

1 - Force “Render Using” to Mental Ray.

Actually no need to force the MentalRay settings…
Better to create the nodes from scratch as below :

mrNodesName = ["mentalrayItemsList",  "mentalrayGlobals", "miDefaultFramebuffer", "miDefaultOptions"]
    mrNodes = ["mentalrayItemsList",  "mentalrayGlobals", "mentalrayFramebuffer", "mentalrayOptions"]

    for i in range(0, len(mrNodes)):
        if not cmds.objExists(mrNodesName[i]):
            cmds.createNode(mrNodes[i], n=mrNodesName[i])

Then able to access those attributes for other settings.
Mayatomr will work a charm.
It seems they are connected each other when rendering with Mental Ray, but if creating them from scratch and do not connect them seems to work the same… at least… for now… :smiley:

4 - Image Format

cmds.setAttr("mentalrayGlobals.imageFormat", 7)

5 - Image Size (Width and Height)

cmds.setAttr("defaultResolution.width", 500)
    cmds.setAttr("defaultResolution.height", 500)
    cmds.setAttr("defaultResolution.deviceAspectRatio", 1)
    cmds.setAttr("defaultResolution.pixelAspect", 1)

The color management attributes really do nothing on output… =_=#

cmds.setAttr("defaultViewColorManager.imageColorProfile", 2)
    cmds.setAttr("defaultViewColorManager.displayColorProfile", 2)

Well still looking for 2,3,6…

2 - Color Management > force True

Browsing those files :

  • colorManagementUtilities.mel
  • createMayaSoftwareCommonGlobalsTab.mel

I found this :

cmds.colorManagementPrefs(e=True, outputTransformEnabled=True)