return to main index


    RifPlugin Mesh2Blobby.cpp (as html).


The rif plugin presented by this tutorial is intended to demonstrate a few techniques the reader might find useful when developing their own plugins. The Mesh2Blobby plugin enables one or more polymesh surfaces, with or without a "subdiv scheme", to be converted to Blobbies at render-time. For example, figure 1 shows a Maya scene consisting of a distorted poly cube and a truncated poly sphere. Figure 2 shows the objects rendered (occlusion) with and without blobby conversion.

Figure 1 - basic mesh geometries

Figure 2 - Rollover without and with the rif.

Compiling the Rif

Follow the instructions presented in "Cutter: Compiling and Building Plugins"

Applying the Rif in Maya

With version 22 of RfM the GUI that enabled RifPlugins to be conveniently used with Maya is not available. However, there is a work-around, but it assumes the reader has downloaded the scripts given in the tutorial "RfM 22: Customizing" and has reviewed their use for batch rendering outlined in the tutorial "RfM 22: Batch Rendering and Filtering".


1   Select a polymesh object that you wish to be rendered as a blobby.
2   Open the script editor (MEL tab) and execute the following commands,
      addFloatPrimVar("blobby", 1);
      addFloatPrimVar("blob_min", 0.1);
      addFloatPrimVar("blob_max", 0.2);

3   To confirm the additional channels have been added go to the Channels tab.

Figure 1

Note the names have each has automatically been given the prefix rmamcF. Their prefixes will ensure the value of each channel will become primvars that can be read by the mesh2blobby RifPlugin.

Open the Render Settings AOV's tab and change the displayType of the beauty to "d_it". This will ensure the rendered image will be displayed in Pixar's Render Tool rather than being saved as a openexr file.

Figure 2

5   Execute the following python commands in the script editor (Python tab),

import batch
rifs = [ ['FULL_PATH_TO/Mesh2Blobby','0.2'] ]
batch.render(1,1, rifs)

The value of 0.2 will be used by the RifPlugin if it cannot find the primvar values of blob_min and blob_max. In which case the blobs will be of uniform sizes.

© 2002- Malcolm Kesson. All rights reserved.