Set mental ray string options

Plugins linking to this thread: (hide)

Mental Ray String OptionsAuthor: Reinhard Claus
Here's an addon which sets arbitrary mental ray string options.

Usage: create a geoshader primitive, apply this shader. The items are strings, interpreted internally this way: numbers only in string (394) -> sets an integer string option numbers and decimal point in string (232.1) -> set a float string option comma in the string (20,10.34,105.0) -> sets a vector2, 3 or 4 string option - depending on the # of commas string = on or true -> sets a boolean string option (true) string = off or false -> sets a boolean string option (false) in all other cases, or if the sting is inside double quotes -> set a "string" string option


Source code is available from here

local backup: custStringOptions.xsiaddon

User avatar
rray
Moderator
Posts: 1684
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany

Set mental ray string options

Post by rray » 26 Jan 2013, 15:03

(Extracted from the New Mental Ray shaders development thread in case there's additional questions about this)

Image

Here's an addon which sets arbitrary mental ray string options

Usage: create a geoshader primitive, apply this shader.

The items are strings, interpreted internally this way:

numbers only in string (394) -> sets an integer string option
numbers and decimal point in string (232.1) -> set a float string option
comma in the string (20,10.34,105.0) -> sets a vector2, 3 or 4 string option - depending on the # of commas
string = on or true -> sets a boolean string option (true)
string = off or false -> sets a boolean string option (false)
in all other cases, or if the sting is inside double quotes -> set a "string" string option

PPG supports 12 option entries so far, further community development would be welcome (for example removing the 12 entry limit by making it into a dynamic list.. have no idea how to do that)

download @V1.0
You do not have the required permissions to view the files attached to this post.
softimage resources section updated Feb 7 2019

User avatar
Daniel Brassard
Posts: 871
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario

Re: Set mental ray string options

Post by Daniel Brassard » 26 Jan 2013, 17:25

Good work RRay, is the string options applied globally on the scene or locally to the geoshader?

Can you add the variable type (maybe as a dropdown menu like Maya for boolean, integer, scalar, string, color, vector or light) or is it done automatically?

edit (i think, based on your previous thread, it is internally interpreted, just to confirm)

If it is done automatically, what are the type limitations (only those you mentioned or is there some other type as well)?

Could it also be done by modifying MR .rayrc or .ray3rc environment variables?

Dan
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
rray
Moderator
Posts: 1684
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany

Re: Set mental ray string options

Post by rray » 27 Jan 2013, 04:22

Hi the settable types are all covered i believe, and you're right-- type is detected automatically.
(make sure for example to type 1.0 instead of 1 if the option expects a float)

Settings are global

About the rayrc files-Don't know that , never use these files before.
softimage resources section updated Feb 7 2019

User avatar
Hirazi Blue
Administrator
Posts: 4973
Joined: 04 Jun 2009, 12:15

Re: Set mental ray string options

Post by Hirazi Blue » 27 Jan 2013, 12:17

@Daniel Brassard - From what I have gathered ("and when was I ever wrong?" =)) ), there is a distinct difference between Mental Ray Configuration (AKA Environment) Variables, which are set on the application level ("which apply to all renderings that share this configuration") and these kind of String Options, which are set on a scene (or even an object?) level.
The configuration files are used for setting the Configuration Variables, not the Scene Render Options, although there is a Configuration Variable called "MI_RAY_OPTIONS" that might possibly allow you to set scene overriding options in such a Configuration file. But I've never tested this successfully, so I can't say for sure.
:-s

@rray - Kudos for the plugin btw.
...

User avatar
Daniel Brassard
Posts: 871
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario

Re: Set mental ray string options

Post by Daniel Brassard » 27 Jan 2013, 15:56

thank you for the explanation.

this was missing from Softimage since 2008 .... now we can at least try new things with MR until they get implemented properly.

Dan
$ifndef "Softimage"
set "Softimage" "true"
$endif

Kzin
Posts: 432
Joined: 09 Jun 2009, 11:36

Re: Set mental ray string options

Post by Kzin » 26 Mar 2013, 20:04

is it possible to create strings without a geo shader?
because the geo shader refresh bug makes strings inside of it useless.
for example, i exposed the native_ibl thru strings, works good, but it has the same refresh problems like other things in a geo shader so it will not be possible to render pass outputs without to rendering 2 frames because the first is missing the ibl because the geo shader dont give informations to xsi internally (and yep, bug is reported).

User avatar
rray
Moderator
Posts: 1684
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany

Re: Set mental ray string options

Post by rray » 27 Mar 2013, 20:51

I have no idea, the geoshader workaround for injecting strings is the only option I've ever heard of. There must be some other way to do something that simple. Would be interested if you find out anything!
softimage resources section updated Feb 7 2019

Kzin
Posts: 432
Joined: 09 Jun 2009, 11:36

Re: Set mental ray string options

Post by Kzin » 28 Mar 2013, 00:15

rray wrote:I have no idea, the geoshader workaround for injecting strings is the only option I've ever heard of. There must be some other way to do something that simple. Would be interested if you find out anything!
its really disappointing at the moment with xsi and mr features. everytime you think there is some hope for better feature access (especially strings would make more things available) it will be destroyed because of that geo shader bug and other bugs which will not be fixed.
i am actually in a situation in which i loose all hope on that topic and i really mean ALL.
problem is you get no feedback from ad, nothing, silence everywhere and the user "looks dumb out of his used cloths".

anyway, thanks for your effort. :)