Cutter
RifPlugins Tool


return to main index

Sample Code:
    Particles_rif.cpp



Overview

The "Rif Tool" is intended to make it easier for plugin developers to debug their rifs. Pixar's documentation that outlines the use of rif plugins written in C++ can be found here,
    Plug-in Rif Filters

The features of the tool will demonstrated with a simple rif, Particles_rif.cpp that can be used to override the limitations of Maya's Particles and nParticles attribute editor. Refer to the tutorial, "RifPlugin: Particles", for information about compiling and building the Particles plugin.


Cutter - Check the Path to RPS

Assuming the reader has successfully created the Particles plugin for their operating system - Particles.so on Linux and OSX or Particles.dll on Windows, the path to Pixar's RenderManProServer has been set correctly in Cutter.

Open the Preferences Tool using the Edit menu (Show Preferences). Click on the Rman->Pixar tab and ensure the path to "RPS root" is correct - figure 1. Save any changes you make to the path using the "Save Pixar" button.



Figure 1


Maya - Generate a Rib of a Particle System

Set a project and create a particle emitter and generate a stream of particles. Assign the PxrDisney material to the particles. Save the scene. In the "Common" tab of the Render Settings window ensure the "Image Format" dropdown menu is set to "It8 (it)" or "It16 (it)". Also, check the "Frame/Animation ext" is set to "name.ext (Single Frame)" - figure 2.



Figure 2


In Maya's script editor execute the following Mel command.
    rman genrib;
It will create a beauty pass rib that will be used by the "Rif Tool" to test the Particles rif.


Using the "Rif Tool"

Open the tool from the Tools menu. In the "Rif" panel use the browse button "?" to identify the rif (Particles.so or Particles.dll). In the "Args" field enter a value such as 0.004. In the "Ribs" panel point the "Source" text field to the Maya rib. In the "Filtered" text field enter the path to an output rib file - figure 4.



Figure 4


Before testing the Sides filter open the source rib using the "Open Source" button and remove the following line of text.

    ##rifcontrol insert begin -rif RLFInjector -rifend

Otherwise, the error shown in figure 5 will be reported.



Figure 5


Save the changes made to the source rib and then click the "catrib" button. Use the "Open Filtered" button to inspect the rib. All instances of Sides should have a value that corresponds to the "Args" text field.



Using the Rif with Maya

Open the Render Settings window and select the Advanced tab. In the Ri Filters panel click "New Rif" and use the directory browse button to find Sides.so. In the "Rif Args" text field enter the value 1 - figure 6.



Figure 6


Figure 7 shows the same scene rendered with the args value set to 1 and 2.



Figure 7




© 2002- Malcolm Kesson. All rights reserved.