Ramp Parameter VEX node

Represents a user-editable ramp parameter.

All Parameters Inputs Outputs

See also: Constant, Global Variables, Output Variables, Shading Layer Parameter

The Ramp Parameter node represents a ramp user interface. The input specifies an index into the ramp. The value of the ramp at that position is the node’s output.

See the page on ramp parameters for more information on working with ramps.

Parameters

Ramp Type

Whether this parameter is a color ramp (vector) or spline (float).

Parameter Name

The name of the new parameter, both in the VEX function declaration, the definition of any OP type that uses the VOPNET, and the VOP tile’s output. If a parameter by this name already exists, this operator will reference it and will disable most of of its own fields, such as the Parameter Type and Parameter Label.

The name must not be a reserved keyword.

Default Basis

The default method for interpolating between ramp keys, for example “Linear” or “Spline”. The user can change the basis in the ramp interface, but this sets the default.

Use This Node to Set Parameter Attributes

When several Parameter VOPs have the same Parameter Name, only one of the nodes is used to control the attributes of the parameter. Houdini decides which node to use for this by searching all the nodes according to the user defined order, then traversing inside subnets. If none of them have this parameter turned on, the first one found is used to set the parameter attributes. If one or more do have this option turned on, the first one with this option is used, even if another node (with this option turned off) is found first.

Parameter Label

A human-readable label for this parameter. Appears in the parent node’s parameters and the tooltip when the user hovers over the output on the VOP tile.

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.

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.

Help text

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

Inputs

Position

The index into the ramp. The Ramp Parameter node outputs the value of the ramp at this position.

Outputs

Parameter

The value of the ramp at the position specified by the input to this node.

Usages in other examples

Example name Example for

Load | Launch