return to main index

Source Code: Particles_rif.cpp


The RifPlugin presented here is intended for use with Maya's Particles and nParticles when their "Particle Render Type" has been set to either Points, MultiPoint, Streak or MultiStreak. In the "Shading" panel of the particle shape tab the minimum size of the particles "Line Width" or "Point Size" is 1. Often this value is too large. A work-around suggested on Pixar's RenderMan forum is,

"You can get around it by adding your own float constantwidth primvar to the particle shape node, and put in your width there."

This tutorial solves the problem with a rif that uses two callbacks,

    RtVoid Particles::points(...)
    RtVoid Particles::curves(...)

to override the value of the points and curves "constantwidth" parameter.

Step 1 - Compile the Rif plugin

Refer to the tutorial "Cutter: C++ RifPlugins" for information about setting up and using Cutter to compile, link and build plugins.

Step 2 - Using the Rif plugin

Go to the Render Settings Advanced tab and browse for the compiled plugin. On Windows the plugin will be named "Particles.dll". On Linux and OSX it's name will be Particles.so. Set the size you wish to render the particles or streaks in the "Rif Args" text field.

Figure 2

Step 3 - Render and Adjust

Render your particle system. With the "it" (Image Tool) window next to Maya's Render Setting window finding the preferred width of the particles is simply a matter of changing the value in the "Rif Args" field and then pressing the "R" key in the "it" window.

Figure 3 shows a simple particle system rendered at the minimum "Line Width" of 1 and at 0.005 using the Rif plugin.

Figure 3 (mouse-over)

© 2002- Malcolm Kesson. All rights reserved.