How to set mental ray render settings using maya.standalone

Hi all,

can any one help me figure out how to set render settings to a maya file by using maya standalone non GUI mode.
when using some commands like mel.eval(‘fillSelectedTabForTabLayout(“mentalRayTabLayout”)’), it is throwing an error. can any one guide me with correct procedure.

Thanks in Advance.

fillSelectedTabForTabLayout is a command that operates on the Render Settings UI. maya standalone doesn’t support UIs so that command won’t do anything. MR render settings are stored on the miDefaultOptions node. You just need to set the attributes on miDefaultOptions to whatever values you want.

For instance miDefaultOptions.minSamples controls Min Sample Level that you see in the Quality tab.

why not just use maya’s batch render? You can set all the settings you need then.

I second capper you need to use miDefaultOptions node to set mental ray render setting options

Hi All,

Thanks for your replies.

when i am using mc.setAttr(“miDefaultOptions.filter”,3), It is displaying an error : - ‘No object matches name: miDefaultOptions.filter’

can anyone send me the code for standalone to recognize miDefaultOptions.

Thank you.

[QUOTE=capper;22970]fillSelectedTabForTabLayout is a command that operates on the Render Settings UI. maya standalone doesn’t support UIs so that command won’t do anything. MR render settings are stored on the miDefaultOptions node. You just need to set the attributes on miDefaultOptions to whatever values you want.

For instance miDefaultOptions.minSamples controls Min Sample Level that you see in the Quality tab.[/QUOTE]

Hi,

Thank you for your reply.

when i am using mc.setAttr(“miDefaultOptions.filter”,3), It is displaying an error : - ‘No object matches name: miDefaultOptions.filter’

can you send me the code for standalone to recognize miDefaultOptions.

Thank you.

Is mental ray plugin loaded ? Until it is loaded the mi nodes don’t exist !

		if not cmds.pluginInfo("Mayatomr", query=True, loaded=True):
			cmds.loadPlugin("Mayatomr")

Hi nezus,

I have already added mental ray plugin loading lines in my script. but too, i am not able to set mental ray settings in standalone mode.

Thank you.

This snippet works fine for me

import maya.standalone
maya.standalone.initialize()

import maya.cmds as cmds

if not cmds.pluginInfo("Mayatomr", query=True, loaded=True):
	cmds.loadPlugin("Mayatomr")
	
cmds.setAttr("miDefaultOptions.filter",3)
print cmds.getAttr("miDefaultOptions.filter")

Could you try it to rule out any environment issue ?

[QUOTE=nezus;23004]This snippet works fine for me

import maya.standalone
maya.standalone.initialize()

import maya.cmds as cmds

if not cmds.pluginInfo("Mayatomr", query=True, loaded=True):
	cmds.loadPlugin("Mayatomr")
	
cmds.setAttr("miDefaultOptions.filter",3)
print cmds.getAttr("miDefaultOptions.filter")

Could you try it to rule out any environment issue ?[/QUOTE]

Hi nezus,
Everything working fine upto the line cmds.loadPlugin(“Mayatomr”). but when i run cmds.setAttr(“miDefaultOptions.filter”,3), it is saying “No object matches name: miDefaultOptions.filter”

if possible, can u please send me the attributes which are effected when i change the quality to “production” in the quality tab. so that, i will add them line by line in my standalone.

Thank you.

Have a look at this post.

Thank you all for your replies.
your suggestions had helped me a lot.

lastly, can u please send me the attributes which are effected when i change the quality Preset to “production” in the quality tab. so that, i will add them line by line in my standalone.

The quality optionMenu calls the function RGsetDefaultQuality in Autodesk\Maya2013\scripts\others\createMayaSoftwareGlobalsTab.mel

You can find the attributes there.