RfM
Python rif_mesh2curves


return to main index


Code

    Python Rif rif_mesh2curves.py (as html).



Introduction

The rif_mesh2curves module enables one or more polymesh surfaces to have their edges represented by linear curves. For example, figure 1 shows a Maya scene consisting of a distorted poly sphere rendered as a wireframe. Figure 2 shows both the polymesh and it's edges converted to curves.


Figure 1 - mesh edges represented by linear RiCurves


Figure 2 - mesh plus linear RiCurves.



Applying the Rif in Maya

RfM does not provide a GUI that enables python rifs to be used in an artist friendly way. 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".


Workflow

1   Select a polymesh object that you wish to be rendered as a wireframe.
2   Open the script editor (MEL tab) and execute the following command,
      addFloatPrimVar("curve_mode", 1);
The value of 1 tags the polymesh for it's edges to be represented by linear curves - wireframe. A value of 2 tags the mesh for rendering normally AND for it's edges to be shown as wireframe representations. 3   To confirm the additional channel has been added go to the Channels tab.



Figure 3


Note the name have each has automatically been given the prefix rmamcF. The prefixe will ensure the value of the channel will become a primvar that can be read by the rif.

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



Figure 4


The value of 0.02 sets the width of the linear curves and the tuple (or list) sets a primvar bound to the Ricurves that can be read by a PxrPrimvar node for the purpose of colorizing the curves.



Figure 5




Figure 6










© 2002- Malcolm Kesson. All rights reserved.