Hey all,

I'm making a script which relies heavily on mental ray. I'm using
pymel (which helps a lot with mental ray commands), but I hit a
problem when I try to customize any of the render quality settings.

For example:


if pluginInfo("Mayatomr", query=True, loaded=True) != 1 :
        loadPlugin( "Mayatomr" )
else :
        print "The Mental Ray plugin is loaded."

setAttr("defaultRenderGlobals.currentRenderer", "mentalRay",
type="string")
setAttr("defaultRenderGlobals.enableDefaultLight", 0)
setAttr("miDefaultOptions.minSamples", 0)
setAttr("miDefaultOptions.maxSamples", 2)


Once Maya hits the lines of code where I'm trying to edit the anti-
aliasing samples I'll get an error. But if I click on the quality tab
(and I guess this is enabling the mental ray globals?) and run the
same two lines

setAttr("miDefaultOptions.minSamples", 0)
setAttr("miDefaultOptions.maxSamples", 2)

it works!

So, I'm guessing somehow I need a line or two of code beforehand
enabling the mental ray globals.

Does anyone know how to do this?

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

Reply via email to