set "name" ["value"]Assign the value value to the variable name.
registry "name" [value "value"] [link "library.so/dll"] [code "sourcefile.c"] [mi "scenefile.mi"] [spdl "scenefile.spdl"] [echo "string"] [system "shell command"] ["key" "value"] end registryCreate a mental ray registry entry. In general, any string can be used as name. However, it is common in mental ray to enclose the string in curly braces
{
name}
. The braces allow mental ray
to detect registry keys in any string and will enable automatic and
recursive registry substitutions without explicit
lookup commands.
The value of a registry entry is specified with the value
statement, which defines the value returned from
registry substitution.
There can only be a single value, any secondary value
command issued for on an already existing registry key will overwrite.
The other optional fields of a registry entry can be used to execute side
effects upon lookup, or to define custom fields.
$lookup "name"
This command looks up a registry name previously defined with a registry command, and executes the statements found there: link loads a library; code compiles and links source code; mi reads a scene file like $include; spdl reads a scene file in Softimage SPDL syntax; echo prints a string to the console; and system executes a shell command. Lookup statements are useful as facility macros. For example, to make a set of features available to mental ray, a single lookup statement can load the library, load .mi declarations for it, and print a message to the screen.
mental ray recognizes registry variables with the prefix _MI_REG_ and uses them for internal configuration purposes, and it provides and sets registry variables with _MI_RAY prefix for customization, see Registry Variables.
mental ray performs auto-expansion of registry keys when resolving
file pathes. A registry key is identified by a non-empty string in curly
braces, like in {mykey}
. The expansion procedure is
supporting recursions, when a registry value is using other registry
keys itself as in the example below.
registry "{root}" value "/home" end registry registry "{path}" value "{root}/users" end registryIf the registry key name is prefixed with an underline character as in
{_mykey}
then this will suppress the usual error condition
and error message in mental ray when the registry entry does not exist. No
expansion is performed in this case.
Registry expansion can also lookup environment variables. The form
{$var}
expands to the string value of the environment
variable varif existing, otherwise it returns the empty string.
With the help of conditionals, this can be used to
customize mental ray by writing a common rayrc
with default
settings but is reacting to temporary overrides using environment variables,
like this:
$ifdef "${?USER_PATH}" registry "{USRPATH}" value "{$USER_PATH}" end registry $else registry "{USRPATH}" value "/home/shaders" end registry $endif registry "{_MI_REG_LIBRARY}" value "{USRPATH};/usr/local/mi/shaders" end registry
Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.