User guide

97
Conditional Visibility Example
1. Create a Katana scene with a PrimitiveCreate node, a Material node, a CameraCreate node, and a Merge node.
Connect the outputs of the PrimitiveCreate, Material, and CameraCreate nodes to inputs on the Merge node.
2. Create a MaterialAssign node, and place it downstream of the Merge node, then add Gaffer and RenderSettings
nodes in series, downstream of that. Finally add a Render node.
NOTE: You can overload Material and Gaffer nodes with more than one shader type. For example, a
Material node can hold both Arnold and PRMan shaders.
At render time, only shaders relevant to the selected renderer are considered.
3. In the Material node, add a PRMan surface shader of type KatanaPhong, and an Arnold surface shader of type
standard.
4. In the Gaffer node add both a PRMan spotlight, and an Arnold spotlight, switching profiles to do so.
Add two lights, and in their respective Material tabs choose Add Shader, then choose either Arnold or PRMan
light. From the drop-down menus, choose spot_light for the arnoldLightShader, and KatanaSpotlight for
the prmanLightShader. (You can also use other renderers and their shaders if you have access to them instead
PRMan and Arnold.)
Position the lights, and remember to set the decay_type in the arnoldLightShader to constant, to match the
default decay type of a PRMan spotlight (the Arnold default is quadratic).
5. Select all of the nodes, bar the Render node, and enter G to make a Group node containing all of the selected
nodes. The result is a Group node, with a single output, connected to a Render node.
To switch between PRMan and Arnold rendering, you can go into the Group node, and change the RenderSettings
node renderer parameter, but to streamline this operation, you can add a pop-up menu to the UI of the Group
node, and link by expression to the renderer parameter on the RenderSettings node.
6. Select the Group, and select the > Edit User Parameters.
7. Select Add > String, and then the new parameter’s > Widget Type > Popup Menu.
8. Select the new parameter’s > Widget Options...
9. In the widget options window, select Add > New Entry, so there are two entries in the menu. Edit one entry to
read arnold and the other to read prman then click OK.
10. In the Group node’s Parameters tab, right-click on the pop-up menu widget, and select Copy.
11. Expand the contents of the Group node in the Node Graph. Select the nodes that you want to edit and use the
Alt+E keyboard shortcut to edit all of their parameters in the Parameters tab. Right-click on the nodes
renderer parameter, and select Paste Expression.
The background of the renderer parameter turns blue, to indicate that it’s driven by an expression.
The value of the Render Settings node renderer parameter is linked by expression to the selected entry in the
Group nodes pop-up menu. If you select the group’s
13 GROUPS, MACROS, AND SUPER TOOLS | MACROS