Automatic Parameter Translation
 
 
 

For automatic translation of parameters to be possible, a texture map plug-in must contain a ParamBlock2 which is a one-to-one match to the parameters structure in the mental ray shader. Every parameter block that you want to be automatically translated must have a matching structure in the mental ray shader. For example, if your plug-in has a parameter block that is called "Parameters", then the mental ray shader must have a structure that is called "Parameters". The contents of the parameter block will be matched with the contents of the structure.

The contents of the parameter blocks must also be a one-to-one match with the contents of the structure in the mental ray shader. That is, each parameter that you want to be automatically translated must match by name and by type to the parameter in the mental ray shader. The following table describes type compatibility. Note that automatic translation is not case sensitive.

Parameter type in mental ray shader

Possible types in the parameter block

boolean

TYPE_BOOL, TYPE_INT

integer

TYPE_INT, TYPE_BOOL, TYPE_TIMEVALUE, TYPE_RADIOBTN_INDEX, TYPE_INDEX

scalar

TYPE_FLOAT, TYPE_ANGLE, TYPE_PCNT_FRAC, TYPE_WORLD, TYPE_COLOR_CHANNEL

vector

TYPE_POINT3, TYPE_RGBA

transform

TYPE_MATRIX3

color

TYPE_RGBA, TYPE_POINT3, TYPE_POINT4**, TYPE_FRGBA**

shader, data

TYPE_TEXMAP, TYPE_REFTARG (reference target must be a Texmap*)

colortexture, secalartexture, vectortexture

TYPE_FILENAME if the parameter doesn't have the GUI attribute <"textureInfo" "max_texmap">, and TYPE_TEXMAP/TYPE_REFTARG if it does have the GUI attribute.

light

TYPE_INODE, TYPE_REFTARG (reference target must be INode*)

string

TYPE_STRING, TYPE_FILENAME

lightprofile

unsupported

geometry

TYPE_INODE, TYPE_REFTARG (reference target must be INode*)

material

TYPE_MTL, TYPE_REFTARG (reference target must be Mtl*)

struct*

TYPE_PBLOCK2*

array

Tab of parameters (e.g. "array boolean" is compatible with TYPE_BOOL_TAB and TYPE_INT_TAB).

* Structure must also match. If the mental ray shader contains a sub-structure of parameters, then the parameter block in the texture map plug-in must contain a sub-parameter-block of the same name, and the contents of the sub-parameter-block will be matched with the contents of the sub-structure.

** As long as the parameter does not have the GUI attribute "no_alpha".