RMS
|
|
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"]
Surface ...
# preShapeScript rib statements are
# added here...
TransformBegin
ReadArchive ...
Procedural "DelayedReadArchive"...
TransformEnd
# postShapeScript rib statements are
# added here...
AttributeEnd
AttributeEnd
AttributeEnd
|
|
The data from a transform node appears in the rib file with the
|
Adding a Post Transform Proc
In this example a Step 1Select the pCube1 tab and choose "Manage Attributes..." (figure 1).
Step 2
From the list of attributes (figure 2) choose
Step 3
An
Step 4
Because the addSquashySphereRI proc adds a sphere to the scene that that is intended to
replace the cube to which it is "attached", the
|
A Sample User ProcThe following mel proc adds a quadric sphere as a replacement to the cube to which it is attached. The cube merely acts as a proxy object. The mel script adds arbitary scalings to the sphere so that it squashes and stretches on its y-axis.
The script should be saved in your favorite scripts directory. For example, it
might be saved in the source "addSquashySphereRI.mel"; |
Script Naming ConventionsNaming conventions are either a subject of personal preference or are imposed on an artist by the established practices of the studio in which they work. Depending on your circumstances you may prefer to ignore this section. Mel scripts that play some role in adding rib to the final output rib stream may be considered, by their functionality, to fall into two groups. UI front-end
These procs setup what
an artist will see in the Extra RenderMan Attributes panel ie. its user interface.
Procs in this group are generally activated by buttons added to the Maya custom shelf.
Such procs automate the task of assigning, say, a RI back-end
The second group of procs determines what an artist wants based on the "state" of any
UI widgets as well as calling the addSquashySphereRI.mel In the next section a "front-end" proc will be implemented. An additional file will alse provide additional UI information. Depending on the complexity of what we are trying to achieve with our Ri/Mel scripting we will have one, two or three scripts. addSquashySphereUI.mel
addSquashySphereUI.rman
As a final note on the subject of naming conventions. The sample mel scripts in this and other sections will always use the name of the script as the name of its main proc.
|
|||||||||||||||||
© 2002- Malcolm Kesson. All rights reserved.