enjoyMentalRayStringOptions, a UI to easely use MR string options


Hi all!

I’d just finished the “beta” version of my script to quickly have a way to handle mental ray string options without have to wait too long. :cool:

The main goal here is not to provide the best integrated/nice UI but avoid to manage mental ray string options “by hands”.

For now, it work for me. Should work for you, but if you have probs, don’t hesitate to post errors (prefered with “Show stack trace” and “Line number in errors” options checked :wink: )

Put the script in your (for example):


To use it, open the script editor, create a new Python tab and just paste:

import enjoyMentalRayStringOptions

Hope you like! :beer:

FG Passes don’t seems to work on Maya 2012. Seems to be a bug of MR.

Release Note:
[li]0.98 - Add a lot of new 3.11 string options
[/li][li]0.97 - Add “mila glossy samples” string option in misc
[/li][li]0.96 - Add a lot of new string options
[/li][li]0.95 - Add “light relative scale” string option
[/li][li]0.94 - Many improvments
[/li][li]0.93 - Add finalgather passes.
[/li][li]0.92 - Add iRay string options.
[/li][li]0.91 - Add “samples per object” and “finalgather legacy” options.
[/li][li]0.9 - Original release.

PS: Thanks to Sylvain Berger for his script k_progressiveRendering wich make me start this more general string options manager. :slight_smile:


Thank you for the script:thumbsup:


I will give it a try Thanks for sharing


Might want to add “samples per object” boolean to Unified. And “finalgather legacy” boolean to get around the MAP rebuild bug.

Other than that, looks great.


Thanks for feedbacks! I will do that as soon as I can (go to work now :cool: )

I didn’t find “samples per object” in the doc:


But this is in release note:


So I suppose this option is not yet documented. I will aslo add others features of the page.

Same for “finalgather legacy”. I didn’t find it. :confused: even in the options doc.

If I’ve miss something, don’t hesitate to give me the documented page! :slight_smile:


It helps to have a few different eyes looking at the docs. I miss things time to time as well.


I had added the “samples per object”. :slight_smile:

I’ve found a lot of string options in the release note… But no “finalgather legacy”

  • “finalgather precomputation legacy”
    Bug fix: Fiixed possible assertion/crash when finalgather precomputation with legacy mode was aborted. v3.9.1.2

  • “finalgather flip bad geom normal”
    During finalgather precomputation, no longer check if the angle between interpolated normal and geometry normal is below 90 degrees and flip geometry normal in such cases. The large angle can be a result of a string bump mapping is applied.

mental ray and earlier versions printed a warning and flipped geometry normal, assuming that the issue originates from an incorrect shader. Many old shaders which computed the irradiance on the back side failed to flip the geometry normal.

The old geometry normal flipping behavior can be enabled. v3.9.0.6

  • “finalgather precomp legacy” (Wait… What? You mean “precomputation” no?)
    For compatibility with mental ray 3.7 and prior, single pass finalgather progressive display can be enabled. v3.7.50.4

@Bitter and others.

Could you just confirm the string options about final gather legacy?


I believe it is a newer option.

“finalgather legacy” on

This has to do with storage of the final gather points in the original format and not the MAP container. The other string options affect how it is computed. That should be avoided. We just want to use the older storage method.


Ok, I added it! I upload the file to the first post. :slight_smile:

Don’t hesitate to give me feedbacks. :wink:


nice work :smiley:


Ow! I completly forget that! :eek: (I don’t have the iray.dll :blush: )
I will do that as soon as possible! :bounce:


Ok, iRay options are in! :slight_smile:

But I can’t test them… So If you are a iRay user, don’t hesitate to feedback!

I found a undocumented iRay option in the release note ( wich I added: “iray mode”.

I also had prob with some options…

“iray max path length” num int

The default is unspecified, targetting highest quality by the use of virtually unlimited, more precisely sufficiently high, path length.


“iray threads” num int

The default is unspecified, resulting in reasonable CPU contribution to maximize overall performance.

For now, I put 0 instead of “nothing”. Did this work? Did -1 could be considered as “unspecified”? :confused:

Any suggestions?


For “iray max path length” I would default to 4. This would net you enough depth to pass through a physically correct window for example.

I would probably leave the threads alone. But that’s personal preference.


Hi Narann

Thank for share your stuff.
Do you think it’s possible to add FG+IP+IR mode ?


I always put the defaults values referring to the doc. And this two option was not clear so I’ve put 0.

I just ask if iRay behavior is the same when you put nothing or when you put 0 (or maybe -1) to put the value wich will have the same behavior than iRay when you put nothing.

I want to be the less intrusive as possible in the behavior of iRay.



Nice Job! Thx! :beer:


thank you narann! :thumbsup:
i got another request :blush:

finalgather passes


Nice work,

If you can make the windows resizable as well :slight_smile:


Thanks :slight_smile:

Done in 0.93. :slight_smile:

Did this feature is not already used by default in Maya? Seems to be 3.7 a feature.

Once again, if it’s possible, don’t hesitate to check every string options work (iRay, etc…)


About the windows, I will need to change some things. :slight_smile:

Add a scrollbar, collapsable frameLayouts, internal session var to keep the frameLayout open/close state.

I also think to a way to “remove” a string option from Maya…


no, maya is using the old scheme without any passes
i like the new one (3 passes), especially for setup you can see very fast if there is some problem, and it´s using the bucket order of your final image, which is better IMHO

that would be great :wink: