OSL
|
IntroductionThere are two ways of using a compiled .oso shader with Maya's HyperShade. The most direct way is click the tab key in HyperShade's work area, type "osl" and select "PxrOSL" from the menu.
The browse button enables the compiled shader to be loaded.
Although using the PxrOSL node is convenient it does have one major drawback - it ignores shader metadata. For example, the shader shown below has metadata intended to customize the UI of each parameter. |
Listing 1 - uiTest.osl
|
When used by an instance of the PxrOSL node the metadata is ignored and consequently we get a barebones UI.
However, using the method outlined in the next section of this tutorial the UI specified by shader metadata is used correctly.
Unfortunaely, the second method is more complex and relies on, |
Step 1: Registering a UI and Loading a ShaderIf the reader has downloaded the scripts presented in the tutorial "RfM: Customizing" this step is straightforward. Assuming the reader is using the Cutter text editor the following preferences should be set.
|
1 C:/Users/jdoe/Documents/maya/projects/RfM_osl/src 2 C:/Users/jdoe/Documents/maya/projects/RfM_osl 3 C:/Users/jdoe/Documents/maya/projects/RfM_ris/Args 4 C:/Users/jdoe/Documents/maya/projects/RfM_ris 5 C:/Users/jdoe/Documents/maya/projects/RfM_ini/RenderMan_for_Maya.ini |
The RenderMan_for_Maya.ini
downloaded from the "RfM: Customizing" tutorial will
automatically attempt to Step 2: Assigning a Unique rfm_nodeid
Again, assuming the reader is using Cutter this step is
also straightforward. Right mouse click on the name of the shader and select
Cutter will the users shaders and custom pattern .args files, find an unused nodeid and then insert metadata immediately after the name of the shader. For example, shader uiTest [[ int rfm_nodeid = 10, string rfm_classification = "rendernode/RenderMan/pattern", string help = "Brief description goes here." ]] A report showing which nodeid's are currently in use can be generated using Rman Tool.
Successfully registered and loaded shaders will appear the Patterns listing of HyperShade.
|
© 2002- Malcolm Kesson. All rights reserved.