Hi Sylvain,
I forgot to click to send the message back to me, so I just saw this.
Sorry for the delay.
I think you're right, but for some reason it doesn't quite work.
The following works in MEL
miCreateDefaultNodes();
select -r defaultRenderGlobals;
setAttr "miDefaultOptions.minSamples" 0;
setAttr "miDefaultOptions.maxSamples" 2;
I'm not sure if I'm translating it right in python, but for some
reason the mental ray globals don't seem to enable.
This seems like a super simple translation, but maybe I'm missing
something?
-Geoff
On Jan 21, 6:47 am, Sylvain Berger <[email protected]> wrote:
> There is a command to force the creation of all the mental ray nodes in the
> scene. Something like miCreateDefaultNodes, I don`t have Maya on this
> computer, but if you enable all the command logging in the script editor and
> open the mental ray settings in a new scene you should see these command
> outputted.
>
> Hope this helps
>
>
>
> On Thu, Jan 21, 2010 at 3:08 AM, Geoff Hecht <[email protected]> wrote:
> > 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
>
> --
> "A pit would not be complete without a Freeman coming out of it."
> The Vortigaunt
--
http://groups.google.com/group/python_inside_maya