Reference Edit Parameter Interface window

Creates, imports, or edits parameters on a node.

Overview

The controls in this window let you edit which parameters appear in the parameter editor for a node.

You can:

  • Import or “promote” parameters from another node, such as from a surface node up to its geometry container, to make controls more easily available.

  • Add rendering properties.

  • Add extra (“spare”) parameters to a node that can be used by expressions and/or scripts.

Note

This window lets you add/edit/remove parameters for a particular node. It does not affect all nodes of the same type. To edit the parameter interface of a digital asset, use the operator type properties window.

Open the window

  1. Select the node you want to edit in the network editor.

  2. In the parameter editor, click the Gear icon and choose Edit parameter interface.

    This window lets you create new parameters on a node, add rendering controls, and copy parameters from other nodes onto this one.

Import parameters from another node

  1. Open the Edit Parameter Interface window (see above).

  2. Click the From Existing Nodes tab on the left side. Use the tree control to select a parameter on a node, then drag it into the Existing parameters pane, or click the “move right” button.

    OR

    Select the other node in the network editor and drag the parameter directly from the parameter editor into the Existing parameters pane of the Edit Parameter Interface window.

  3. Use the options under Parameter Description on the right side of the window to customize the destination parameter’s appearance and behavior (this does not affect the source parameter on the other node).

When you import a parameter from another node, Houdini automatically edits the source parameter to be a parameter reference expression that looks up the value of the destination parameter. Once you import a parameter, you should only edit the destination parameter, not the source parameter (unless you delete the destination parameter to break the connection).

Render properties

See the section on render properties for information on rendering properties.

  1. Open the Edit Parameter Interface window (see above).

  2. Click the For rendering_ tab on the left side. Use the tree control to select a property, then drag it into the Existing parameters pane, or click the “move right” button.

Spare parameters

Spare parameters let you store extra information on a node. You can add spare parameters to any node to provide extra storage for values and expressions. They are not used directly by the node, but you can reference them in other standard node parameters using expressions. Adding a spare parameter to a node only adds it to that node, not all the nodes of that operator type.

You can keyframe spare parameters, reference them, and add them to takes .

  1. Open the Edit Parameter Interface window (see above).

  2. Click the By type tab on the left side. Select the type of parameter you want to add, then drag it into the Existing parameters pane, or click the “move right” button.

  3. Use the options under Parameter Description on the right side of the window to customize the parameter’s appearance and behavior.

Parameter Description

Parameter Description: Parameter subtab

Name

The internal name of the parameter. You will use this name to refer to the parameter’s value in expressions. It must be unique within this operator type. This name cannot contain spaces or slashes.

Label

A readable label for the parameter. This name can contain spaces.

Turn off the associated checkbox to hide the label. This is especially useful when you lay out parameters side-by-side using the Horizontally join to next parameter option.

Type

The data type this parameter contains.

Angle

A 2D angle (in degrees). You can increase the Size to store up to four angles in a single parameter. Use Direction vector for a 3D direction vector.

Button

An action button. Clicking the button runs the Callback script (see below).

Color

An RGB color. Houdini provides a color swatch/picker UI.

Color and Alpha

An RGBA color. Houdini provides a color swatch/picker UI.

Direction Vector

A vector that represents a direction in 3D space.

File

A path to a file. Houdini provides a file picker UI for the parameter. If this parameter specifies an image file or geometry file, use the more specific datatypes below to have the file picker only show the specific file types.

File - Geometry

A path to a geometry file. Houdini provides a file picker UI that shows geometry files.

File - Image

A path to an image file. Houdini provides a file picker UI that shows image files.

Float

A number with a decimal part.

Float Vector 2, 3, 4

A float vector of two, three, or four components.

Check the rest of the menu for more specific datatypes that might match what you want to store in a vector (such as an RGB color). The more specific datatypes store their values as a vector, but provide extra UI for setting the value (such as a color swatch and color picker for colors).

Folder

A parameter for containing other parameters. See also the folder description below.

Integer

A whole number.

Integer Vector 2, 3, 4

An integer vector of two, three, or four components.

Label

A parameter for providing a read-only label.

Operator List

A space-separated list of node paths. Houdini provides a node picker UI that accepts multiple selections. Use the Op filter option below to restrict this parameter to show certain types of nodes.

Operator Path

A path to a node. Houdini provides a node picker UI. Use the Op filter option below to restrict this parameter to show certain types of nodes.

Ordered Menu

A pop-up menu. See the menu subtab for how to edit the menu items.

RGBA Mask

A channel mask for an RGBA color. Houdini provides a UI that lets you choose the Red, Green, Blue channels, all Color channels (R, G, and B), and/or the Alpha channel.

Ramp (Float)

A ramp parameter for editing curves. To evaluate ramp parameters from scripting, see chramp().

Ramp (RGB)

A ramp parameter for editing color values. To evaluate ramp parameters from scripting, see chramp().

Separator

A horizontal separator.

String

A text string.

Check the rest of the menu for more specific datatypes that might match what you want to store in a string (such as an file path). The more specific datatypes store their values as a string, but provide extra UI for setting the value (such as a file picker for image files).

Toggle

A checkbox. When you read the parameter with ch this will return 0 for off and 1 for on.

UV/UVW

UV or UVW texture coordinates.

Op filter

When Type is Operator path or Operator list, this option lets you restrict the types of nodes shown in the picker UI. For example, if this parameter should contain a surface shader, set Op filter to SHOP: Surface only. This makes it easier for users to pick surface shader by filtering out other node types from the picker.

RMan type

For RenderMan Shader assets, this lets you set the RenderMan datatype to use for this parameter in the output.

Browse Mode

Read and Write

Opens the chooser in an intermediate mode, if possible.

Read Only

Opens the chooser in the open file mode.

Write Only

Opens the chooser in save file mode.

Houdini’s file chooser only recognizes the Read and Write mode and is used for opening files for all three options.

The OS X only recognizes the Read Only and Write Only modes, and fakes the Read and Write mode (needed by Data File DOP, for example) by using Write Only mode. In this mode you cannot create a new file; however, using Write Only mode is still better than Read Only, since Read Only mode presents existing files as not selectable.

On Linux and Windows, you are limited to Houdini’s browser.

Note

The environment variable HOUDINI_USE_NATIVE_FILE_CHOOSER lets you customize Houdini to choose to use the native file browsers or to use Houdini’s.

Size

When Type is Integer, Float, or Angle, sets the number of components in the parameter (1 to 4).

Defaults

The default value for the parameter. If Size is greater than 1, you can specify defaults for each component.

Invisible

Do not show this parameter in the asset’s user interface.

Horizontally join to next parameter

If you have two short, related parameters stacked in the interface, you can turn this option on to lay out the options side-by-side to save space and clarify their relationship.

Range

For numeric datatypes, specifies the range for the slider in the interface.

Click the lock icons to lock/unlock the low and high limits. When a limit is unlocked, the slider uses the limit, but the user can enter values beyond the limit using the text entry box. When a limit is locked, the slider uses the limit, and Houdini prevents the user from entering values beyond the limit.

Callback script

HScript command to run when this parameter is changed by a UI event (or when the button is clicked, if Type is Button).

In your script, the name of the changed parameter is available in $script_parm, and the value is in $script_value. If the parameter has multiple components, you can access them as $script_value0, $script_value1, and so on.

For example, this callback command would open a small window showing the path to the operator and the name of the parameter plus the new value:

message `oppwf()`/$script_parm = $script_value0

Often, you will call a script stored as a section (an embedded file) in a digital asset. For an object type named asset_name, you can run the script in the section named section_name using the following command as the callback:

source opdef:/Object/asset_name?section_name

See how to access the contents of an asset and the source command.

Script language

The scripting language to use to interpret the Callback script.

Suppress Quotes in VOP Code Blocks

Whether this parameter should be expanded without quotes within VOP code blocks. A common use is to allow strings from menus to be placed verbatim in a code block. Only available for string parameters in a VOP definition.

Available for import

Whether this parameter is imported by import folders on a parent asset. See about importing folders from a sub-node above.

Show parm in

The dialogs in which the parameter will appear.

Main dialog

Parameter appears in the parameter editor pane.

Main & tool dialogs

Parameter appears in:

  • The parameter editor pane.

  • The mini-parameter editor that appears when the user presses P while the operator is active.

Main & tool dialogs + toolbox

Parameter appears in:

  • The parameter editor pane.

  • The mini-parameter editor that appears when the user presses P while the operator is active.

  • The operation controls toolbar (at the top of the viewer pane) when the operator is active. Pane > Toolbars and controls > Operation controls).

Disable when

Specifies conditions where the parameter is disabled.

The syntax of the conditions is…

{ parm_name operator value ...} ...

That is, one or more sets of comparisons inside curly braces. Inside the curly braces are one or more comparisons between a parameter and a value, where the operator is one of:

== equal
!= not equal
< less than
> greater than
>= greater than or equal
<= less than or equal

If all of the conditions are true inside any of the curly brace lists, the parameter is disabled.

For example:

{ type == 1 count > 10 } { tolerance < 0.1 }

The parameter will be disabled if…

  • The type parameter equals 1 and the count parameter is greater than 10

    or

  • The tolerance parameter is less than 0.1.

You can omit the operator, in which case it’s assumed to be == (equals). For example…

{ type 1 } { type 2 }

…will disable the parameter if type equals 1 or 2.

You cannot use expressions in the disable when rules. The best you can do is to create an invisible parameter containing the expression you need, and reference it in the disable when rules.

Help

Help string for the parameter. This is displayed in the tool tip when the user hovers over this parameter in the parameter editor.

The controls on this subtab let you create a menu to set the value of the parameter. You can also use the Callback script to take actions based on menu choices.

Each menu item has a token and a label. The token is the value that gets put into the parameter when the user selects the menu item. The label is the human-readable label Houdini uses for the menu item in the interface.

Use menu

Turn on the checkbox to make this parameter into a menu. Use the pop-up menu to choose the type of menu to create.

Normal

A pop-up menu that lets the user choose one value from a list.

Replace

A text box with a menu button that lets the user fill in preset values.

Toggle

A text box with a menu button that lets the user add and remove preset values to/from the current contents.

Menu items/Menu script

Choose “Menu items” to specify a list of static token/label pairs to populate the list. Use this option if the list does not need to change based on runtime conditions.

Choose “Menu script” to specify the list of token/value pairs using a script. Use this option if the contents of the list change based on the current conditions in Houdini (for example, a menu that lets you choose from the currently selected objects).

Menu items list

Click a row in the list to select it.

Use the two text boxes above the list to edit the token and label of the currently selected row.

Use the arrow buttons to reorder the list, and the X buttons to delete rows.

Menu script field

Enter a script here whose output populates the menu. You can write these scripts using either Hscript or Python.

Hscript menu scripts output is a space-separated list in the form:

token "label" token "label" ...

For example:

all "All objects" sops "Surfaces" dops "Dynamics objects"

In general you would use a for or foreach loop to generate a list of token/label pairs from a list.

For example, this script will create a menu where the tokens are the point groups in the current node, and the labels are just the group name converted to upper case.

result = ""
foreach groupname ( pointgroupmask("." + opinput(".", 0), "*") )
    result = $result + " $groupname " + `toupper($groupname)`
end
echo $result

In this example, the menu lists the node’s inputs, where the tokens are the full paths to the nodes, and the labels are the node names:

here = `execute("oppwf")`
result = ""
for index = 0 to `opninputs($here)`
    result = $result + " " + `opfullpath($here + "../" + opinput($here, $index))` + " " + `opinput($here, $index)`
end
echo $result

Python menu scripts return a sequence of strings of the form

("token1", "label1", "token2", "label2", ...)

Houdini uses the same rules for evaluating Python menu scripts as it does for evaluating Python parameter expressions: if the script contains only one line, it is evaluated as an expression. If it contains multiple lines, it is evaluated as the body of a function. Also note that hou.pwd returns the node containing the script.

In this example, the menu lists the node’s inputs, where the tokens are the full paths to the nodes and the labels are the node names:

result = []
for input_node in hou.pwd().inputs():
    result += [input_node.path(), input_node.name()]
return result

See Parameter Menu Scripts for more information on menu scripts written in Python.

Note

Houdini runs this script whenever the user opens the menu, and when the parameter is evaluated, so you want to make the script as simple and fast as possible.

Warning

For integer fields with a menu, the tokens must be numbered consecutively starting at 0.

Example

Create a sphere and add squash and stretch

  1. In this example, we’ll create a new “squash” parameter on a ball object by promoting a parameter from a node inside the ball’s geometry network.

  2. First, use the Sphere tool on the Create shelf to create a sphere. In the operation control toolbar (along the top of the viewer), set the sphere’s Primitive type to Polygon and the Frequency to 4.

  3. Select the sphere and use the Squash and Stretch tool on the Deform shelf to add squash and stretch to the sphere.

  4. The squash and stretch tool automatically dives into the sphere’s geometry container to show you its surface nodes: a sphere node that creates the sphere geometry, and a twist node set to squash and stretch.

  5. Select the twist node (probably called squashstretch1). In the parameter editor you can see that its Operation parameter is set to Squash & Stretch.

  6. Set the node’s Primary axis parameter to Y axis. Set the Pivot to 0 -1 0 to move the center of the squash and stretch to the bottom of the sphere (since the sphere is 1 unit in radius, moving the pivot down 1 along the Y axis puts it at the bottom of the sphere).

  7. Move the mouse over the Strength text box and press and hold . Drag left and right to squash and stretch the sphere.

    Note that negative values squash the sphere down, positive values stretch it up, and that the values need to be fairly small, so the slider beside Strength which goes from 0 to 360 is not very useful. You’ll want to type in values or use the ladder instead.

Promote the Strength parameter from the squash and stretch node

Now we’ll promote the Strength parameter from the squash and stretch node up to the geometry container so we can edit it at the Scene level.

  1. Click Back to return the Scene level.

  2. Click the ball’s object container to show its parameters in the parameter editor.

  3. In the parameter editor, click the Gear menu and choose Edit parameter interface.

  4. In the Edit Parameter Interface window, click From existing nodes on the left side.

  5. Use the tree control to find the squash and stretch node inside the ball. Open it up to show its parameters inside. Drag the strength parameter onto the Existing parameters tree, just above the Translate parameter.

  6. In the Parameter description section on the right side, set the Label option to Squash. This is the human-readable label that will appear in the parameter editor.

  7. In the Interface options subsection below, set the Range to -2, 2.

  8. Click Apply.

  9. Try using the new Squash parameter on the object.