RfM
Introduction to RiMel Scripting


return to main index



Introduction

RenderMan for Maya (RfM) plugin allows extra rib statements to be added to the output rib stream generated by the plugin. Extra rib statements can be added by one or more Mel scripts that have been assigned to the transform and/or shape nodes in a Maya scene.

When RfM traverses the Maya scene graph, gathering data that it puts into the output rib stream it "looks" for one or more Mel "insertion points" from which it will call a users custom Mel proc(s). Such procs can add their own rib statements to the output rib stream through the use of a library of Pixar procedures, each of which has the prefix Ri. For example,

    RiSphere(1, -1, 1, 360);

would cause this rib statement,

    Sphere 1.0 -1.0 1.0 360.0

to appear in the final rib stream. Mel "insertion points" consist of attributes with specific names. The value of such attributes will a string - generally a call to a custom Mel proc. For example, when a scene is rendered if the RfM plugin finds the following attribute,

    rman__torattr___postTransformScript

on a transform node, and its value is,

    myProc();

then the proc will be called by RfM. The next diagram shows where a users Mel procs can be called and where the additional rib statements they create are added to the output rib stream.



Scene Graph




Rib File

AttributeBegin 
   # transformBeginScript rib statements are
   # added here...
   Attribute "identifier" "string name" ["pCube1"]
   ConcatTransform [1 0 0 0  0 1 0 0  0 0 1 0  0 0 0 1]
   # postTransformScript rib statements are
   # added here...
   AttributeBegin 
       AttributeBegin 
           Attribute "identifier" "name" ["pCubeShape1"]
           ##RLF Inject SurfaceShading -attribute sets@...
           # preShapeScript rib statements are
           # added here...
           TransformBegin 
               ReadArchive ... 
               Procedural "DelayedReadArchive"...
           TransformEnd 
           # postShapeScript rib statements are
           # added here...
       AttributeEnd 
   AttributeEnd 
AttributeEnd


Making the Process Artist-Friendly

Generally, the Mel "inseretion points" are used as hooks in conjunction with custom interfaces. Such interfaces allow artists to take advantage of the "at render time" generation of extra geometry. The Cutter text editor can greatly reduce the time it takes to design a custom interface and implement it's functionality. Refer to the tutorial "Cutter: Rman & RiMel Scripting" for information about its features.







© 2002- Malcolm Kesson. All rights reserved.