home << prev next >> contents  


Variables and the Registry

 
set "name" [ "value" ]

Assign the value value to the variable name. Variables are not used by mental ray but provide a general syntax for passing parameters from translators to interactive programs that read scene files without actually parsing any geometric data. For example, translators can store the translator version and name, source scene name, frame range, and other useful information in variables.

 
registry "name" [ "value" ]
[ value "value" ]
[ link "library.so/dll" ]
[ code "sourcefile.c" ]
[ mi "scenefile.mi" ]
[ spdl "scenefile.spdl" ]
[ echo "string" ]
[ system "shell command" ]
end registry

Create a mental ray registry entry. The registry is similar to the symbol table created with the set command, but is actively accessed and evaluated by mental ray. All file paths on disk go through registry substitution, and conditionals use registry keys as well. Any string can be used as a name, but a few that begin with _MI_REG_ have special meanings:

_MI_REG_INCLUDE

an include path where files included by $include commands are found, in addition to paths set with the -I command-line option.

_MI_REG_LIBRARY

an include path where shader libraries linked by link commands are found, in addition to paths set with the -L command-line option.

_MI_REG_TEXTURE

an include path where texture image files referenced by texture statements are found, in addition to paths set with the -T command-line option.

_MI_REG_LIGHTPROFILE

an include path where light profile files referenced by lightprofile statements are found, in addition to paths set with the -lightprofile_path command-line option.

_MI_REG_SWAPDIR

a directory to swap to, unless the -swap_dir command-line option has been specified.

_MI_REG_SWAPLIMIT

the number of megabytes to write to the swap directory, unless the -swap_limit command-line option has been specified.

_MI_REG_FBDIR3.4

a directory where memory mapped frame buffers are stored, unless the -fb_dir command-line option has been specified.

_MI_REG_ASSEMBLY3.6

a directory where assembly files are stored, unless the -assembly command-line option has been specified.

The values must be specified in value statements. Effectively, this allows providing defaults that could otherwise only be specified on the command line. The optional statements other than value are used by the $lookup command; see below. Typically, registry commands are used in the rayrc startup file, usually stored in places like /usr/local/mi on Unix, or at the directory the MI_ROOT environment variable points to.

 
$lookup "name"

This command looks up a a registry name specified with a preceding 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, print a message to the screen, etc.

home << prev next >> contents  


Copyright © 1986-2007 by mental images GmbH