RfM Reyes
|
Introduction
The tutorial "Cutter:HyperShade Node Scripts"
explains Cutter's ability to generate a custom RenderMan hypershade node from a RSL function.
This tutorial demonstrates a three step technique that can be applied to node development.
As an example of the technique this tutorial implements a node called
The user interface of the
The workflow consists of three steps. 1 Implement a RSL function
- write a shader that implements a block of RSL code, 2 Generate a Pixar rslt file
- use Cutter to convert the RSL function to a custom HyperShade node, 3 Register the node
- edit the users RenderMan_for_Maya.ini file. |
Step 1 - Implement a RSL function
The code needed for a RSL function is first implemented by a shader. This is done so that
the code can be tested either with a RIB file or directly in Maya. Once it is confirmed the
shader creates the desired pattern, or effect, the (relevant) code is copied (migrated) to a
RSL function. The function must be implemented in a so-called "header", or .h, file.
|
Listing 1 (ColorByHeight.sl)
Compile the shader to ensure it has no errors. Because the shader was copied from another
Fundza tutorial there is no need to test it with a RIB file or with Maya.
|
Listing 2 (patterns.h)
|
Because the |
Listing 3 (func_test.sl)
Compile the |
Step 2 - Generate a Pixar rslt fileBefore converting the RSL function to a node, "user interface" hints should be added to the inputs of the function. For example, void ColorByHeight(float maxheight, /* [default 10] */ minheight; /* [default 0] */ color maxcolor, /* [default "0.8 0 0"] */ mincolor; /* [default "0 0.8 0"] */ output varying color result)
The ui-hints embedded within comments will ensure Cutter inserts appropriate
default values into the rslt node script. For more information about ui-hints
refer to the tutorial, "Cutter: Ui-Hints".
Save the script generated by Cutter, for example, |
Step 3 - Register the node
The node is "registered" with RfM via the users custom RenderMan_for_Maya.ini
file.
Open your RenderMan_for_Maya.ini file. Its location depends on how your environment is
configured. If the reader has followed the suggestions in, |
# nodeid 1053503 LoadExtension rslt "/Users/$USER/Documents/maya/projects/RfM_hypershade/cutrColorByHeight.h" RAT::LogMsg INFO "cutrColorByHeight has been loaded" |
Make sure the path conforms to the location of your RfM_hypershade director. The final part
of this jigsaw is to edit the userdata { rfm_nodeid 1053503 rfm_classification rendernode/RenderMan/utility } Re-start Maya and, fingers crossed, the new node will appear in the RenderMan/Utilities menu.
|
© 2002- Malcolm Kesson. All rights reserved.