Adding User Parameters

You can add user parameters to any node, but they’re particularly useful in groups and macros, where user parameters on the parent node can drive parameters on child nodes. User parameters can also drive parameters on nodes in the recipe outside of the group or macro. It can be useful to present the user of a group or macro with a series of known, valid choices in the form of a pop-up menu. You can create this, as shown below, by editing the user parameters.

1.   Start with a recipe consisting of a Group node with a child PrimitiveCreate node, and a connection out of the group from the PrimitiveCreate to a Merge node.

2.   Select the Group node and press Alt+E to edit it.
3.   In the Group node’s Parameters tab, click > Edit User Parameters.
4.   On the user parameter, click Add > String.

A new user parameter of type string is created.

5.   Change the widget type of your user parameter to Popup Menu by clicking the menu on the user parameter and selecting Widget Type > Popup Menu.

This changes the user parameters widget type to pop-up menu, where each entry in the menu is a string.

6.   Edit the pop-up menu to add new entries, each corresponding to a valid PrimitiveCreate node type. To do this, in the menu of the new parameter, click Widget Options.... In the resulting widget options dialog, click Add > New Entry, and name them "sphere", "cube", and "cone".

7.   Link the user parameter pop-up menu to the type parameter of the PrimitiveCreate node by right-clicking on the user parameter pop-up menu and clicking Copy, then selecting the PrimitiveCreate node. Right-click on its type parameter, and select Paste > Paste Expression.

The type parameter’s background turns blue to let you know it’s set by an expression.

Tip:  If you want the user parameters to be shown at the top level on the Group node, you can click > Show User Parameters At Top Level in the Group node's parameters before you finish editing the user parameters.

8.   Finish editing the Group node’s user parameters by clicking > Finish Editing User Parameters.
9.   Select the group, then click the pop-up user parameter to change between the "sphere", "cube", and "cone" options. The type parameter of the PrimitiveCreate node changes to match.

Tip:  Katana offers a shortcut to automatically create and populate user parameters. Perform step 3 from the example above, then Shift+click the PrimitiveCreate node as well as the group. Shift+middle-click and drag from the PrimitiveCreate node’s type parameter onto the Group node's Add menu. A new user parameter of the correct type (in this case a pop-up menu), populated with the applicable entries, is created. You still need to link the new menu to the PrimitiveCreate node’s type parameter, but this should speed up the process.