sj_blob


sj_blob_write (custom operator) and sj_blob_read (shader) allow you to pass data of any type (boolean, integer, float, color) from Softimage to mental ray.
They work more or less like the primitive variables data passing supported by RenderMan and MTOR.
Note: for more sophisticated data passing (but at render time only), you can also use sj_radio.

Download

Say for instance you have a group material, so shared by many objects. Yet, you want to have one or more attributes (parameters) to be driven per object.

In the example below, the spheres share the same phong material.
You start by connecting the sj_blob_read outputs to the parameters you plan to control per object. Note that at this stage sj_blob_read acts simply as a big data share node (so, you can also use it simply to replace several bool/int/float/color share nodes at once).

We also give a proper Id (2011 is the default) that will be matched by the custom operator later on, and an optional name for the parameters we connected (Spec, Transp, Amb, Diff in this case).

Next, we select the 3 spheres and run Get->Property->sj_blob_write

For each of the selected objects, a UserDataBlob property is created, and a sj_blob_write operator applied.
If you click the UserDataBlob of a given object, you will see the same list of attributes we had in the shader.
If the UserDataID number matches the shader Id, all the attribues of a given type with the same name are propagated from the objects down to the shader, for that particular object only.
In the example below, the first sphere overrides Spec to false, Amb to white and Diff to red.
The second overrides Diff to green and the transparency to 0.5.
The third does not work, since its UserDataId (2012) does not match the shaders' (2011).