RenderMan
|
IntroductionPrior to 2007 Pixar's high-end production software for Maya was RenderMan Artist Tools (RAT). While it enabled Maya curves to become renderable objects it only allowed a constant width to be assigned to a curve. The RenderMan Specification, however, allows curves to be defined with varying widths and colors. In fact any user-defined attribute can be bound to the curve. With the introduction in 2007 of Pixar's RenderMan Studio (RMS) it became possible to assign, from within the Maya interface, a "base width" and a "tip width" to a curve. Curves generated by RMS smoothly interpolate the width of the curve. Curve widths cannot be assigned on a segment by segment basis. Refer to the tutorial "RenderMan: Maya Curves to Rman Curves" for an explanation of how to blend colors along the length of a curve. |
|
|
Although RMS does not enable more than two widths to be assigned to a curve there are times when it is useful to be able to render curves whose segments have differing multiple widths and/or differing normals. This and another tutorial propose two "work-arounds". The first technique, and the subject of this tutorial, uses a script to post-process the rib file(s) generated by RMS. The second technique is outlined in "RenderMan: Post Processing Curve Normals" and relies on hiding data in the name that Maya assigns to a curve. A script is also used to post-process the rib files but instead of assigning arbitary attribute values to a curve it extracts numeric data from the name of each curve that it applies as additional attributes to the curve. Adding Arbitary WidthsThis tutorial describes the simpliest of the post-processing techniques. In listing 1 a sequence of differing but fixed widths are added to a curve. The values could be semi-randon values. The technique is relatively simple because the values do not depend on any information derived from the Maya scene. Instead the additional values depent solely on the values the Tcl script "decides" to add to a curve or curves. Post processing a sequence of rib files consists of,
Listing 1
Any general purpose scripting/programming language can be used to post-process
rib files. Listing 1 provides an example written in Tcl. The script
processes the rib files located in a "target" or "source" directory. The script assumes
the post-processed rib's are to be saved in a "destination" directory. Before continuing you may wish to
review the tutorial
"Tcl: File Filtering".
Because the tclsh addCurveWidths.tcl The time taken to produce the copies will obviously depend on the number of rib's and their size. Rib files 1MB in size will each take about 2.5 seconds to process. Once the copies have been produced they can be batch rendered. |
© 2002- Malcolm Kesson. All rights reserved.