(Extracted from the New Mental Ray shaders development thread in case there's additional questions about this)
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
Set mental ray string options
Plugins linking to this thread: (hide)
Mental Ray String Options
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
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
author site: rray.de/xsi / si-community thread
Set mental ray string options
- Attachments
-
- custStringOptions_src.zip
- (1.99 KiB) Downloaded 167 times
-
- custStringOptions.zip
- (85.13 KiB) Downloaded 198 times
softimage resources section updated Jan 5th 2024
- Daniel Brassard
- Posts: 878
- Joined: 18 Mar 2010, 23:38
- Location: St. Thomas, Ontario
- Contact:
Re: Set mental ray string options
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
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
set "Softimage" "true"
$endif
Re: Set mental ray string options
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.
(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 Jan 5th 2024
- Hirazi Blue
- Administrator
- Posts: 5107
- Joined: 04 Jun 2009, 12:15
Re: Set mental ray string options
@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.
@rray - Kudos for the plugin btw.
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.
@rray - Kudos for the plugin btw.
Stay safe, sane & healthy!
- Daniel Brassard
- Posts: 878
- Joined: 18 Mar 2010, 23:38
- Location: St. Thomas, Ontario
- Contact:
Re: Set mental ray string options
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
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
set "Softimage" "true"
$endif
Re: Set mental ray string options
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).
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).
Re: Set mental ray string options
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 Jan 5th 2024
Re: Set mental ray string options
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.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!
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.
Who is online
Users browsing this forum: No registered users and 45 guests