# Expression functions

Expression functions let you compute the value of parameters.

See the network and parameters chapter for more information on HScript expressions. You can also use Python in parameters instead of HScript expressions.

## Functions

• Returns the absolute value of the argument.

• Returns the arc-cosine of the argument.

• Returns the angular velocity required to rotate an object from one orientation to another in a certain period of time.

• Returns the arc length of a curve between two U positions.

• Returns the arc length of a curve between two U positions and number of divisions.

• Returns an argument from a list of HScript-style arguments.

• Returns the number of arguments in an HScript-style list of arguments.

• Returns the arc-sine of the argument.

• Returns the arc-tangent of the argument.

• Returns the arc-tangent of y/x.

• Converts a string to a float.

• Returns bounding box information for a surface node.

• Channel segment function: Bezier interpoloation spline

• Returns the angle at the joint between two bone objects.

• Returns the smallest integer not less than the value passed in.

• Returns centroid information for a surface node.

• Returns the value of a parameter.

• Returns 1 if the specified channel exists, 0 if it doesn’t.

• Evaluates a channel with a new segment expression.

• Evaluates a channel with a new segment expression at a given frame.

• Evaluates a channel with a new segment expression at a given time.

• Evaluates a parameter at a given frame.

• return a string containing all of the channels contained in a group.

• Evaluates a channel within a CHOP at the current time.

• Evaluates a channel within a CHOP at a given time.

• Evaluates a channel within a CHOP at a specified sample point.

• Evaluates a channel within a CHOP at a specified time.

• Returns the end index of the channels in a CHOP.

• Evaluates a channel within a CHOP with at a given frame.

• Evaluates a channel within a CHOP at a given sample point.

• Returns the length of the channels in a CHOP, in samples.

• Returns the number of data channels within a CHOP.

• Returns the names of all the data channels within a CHOP.

• Returns the sample rate of a CHOP.

• Returns the start index of a CHOP.

• Returns the string value of a channel within a CHOP at the current time.

• Returns the value of a channel within a CHOP at a specified time.

• Returns the value of a ramp parameter at a specific position.

• Returns the value of a ramp parameter at a specific position and frame.

• Returns the value of a ramp parameter at a specific position and time.

• Evaluates the string value of a parameter at the current time.

• Evaluates the parameter at the current time as a node path string.

• Evaluates the parameter at the current time as a node path list string.

• Returns the raw (unexpanded) expression value of a parameter as a string.

• Returns the value of a parameter at a specified time.

• Returns a value clamped between a minimum and maximum.

• Clamps a vector to always end between a minimum and maximum sphere.

• Channel segment function: constant value.

• Returns a cook context option as a floating point value.

• Returns a cook context option as a string value.

• Tests if metadata exists on a compositing node.

• Returns numeric metadata from a compositing node.

• Returns string metadata from a compositing node.

• Returns the cosine of the argument.

• Returns the hyperbolic cosine of the argument.

• Computes the cross-product of two vectors.

• Channel segment function: cubic spline.

• Deprecated: current working container for custom panels.

• Deprecated: data type of a gadget, for custom panels.

• Deprecated: adds a menu entry on a custom panel.

• Deprecated: returns a value from a custom panel.

• Returns the curvature of the surface at the given UV coordinates.

• Deprecated: Returns the type of a gadget on a custom panel.

• Channel segment function: repeats animation from previous frames.

• Channel segment function: repeats the animation between frames f1 and f2, accumulating the value.

• Channel segment function: repeats the animation between times t1 and t2, accumulating the value.

• Channel segment function: repeats animation from previous frames.

• Converts from radians to degrees.

• Returns the degree a specified face or hull.

• Returns the value of a detail attribute.

• Returns the number of components in a detail attribute.

• Returns the type of a detail attribute.

• Returns the string value of a detail attribute.

• Returns a string from a list of strings in a detail attribute.

• Returns the number of unique stings bound to a detail attribute.

• Returns the determinant of a matrix.

• Computes the dihedral matrix between vectors v0 and v1.

• Returns the distance between two 3D points.

• Returns a space separated list of all the field names that can be passed to the dopfield function.

• Returns the full path of the node connected to a dopnetwork.

• Returns the number of records of a given type in a piece of dynamics data.

• Returns the value of a field as a float.

• Returns the name of a DOP field.

• Returns the value of a DOP field as a string.

• Returns the type of a DOP field.

• Returns the current frame of the simulation.

• Returns the simulation time equivalent of a simulation frame.

• Returns 1 if a specified DOP group contains a specified object.

• Returns 1 if a specified DOP group is mutually affecting.

• returns a string containing a list of all object groups for the current time in a specified DOP Network.

• Returns 1 if a specified DOP field exists.

• Returns 1 if a dynamics object has the specified subdata.

• Returns the list of objects processed by a DOP in the latest timestep.

• Returns the number of fields in a DOP record type.

• returns the number of objects in a simulation.

• Returns the number of records of a given type in a piece of dynamics data.

• Returns the number of types of record in a piece of dynamics data.

• Returns the number of subdata items attached to an object or data.

• Returns all objects matching the an object specification.

• Tests whether a set of objects has an affector relationship with another object.

• Returns the list of objects created by a particular DOP node.

• Returns the value of a DOP field as a float.

• Returns the value of a DOP field as a string.

• Returns the name of a record in DOPs data given its index.

• Script solver support function.

• Script solver support function.

• Script solver support function.

• Script solver support function.

• Script solver support function.

• Script solver support function.

• returns the simulation frame of a given simulation time.

• Returns the global time of a given simulation time.

• Returns the name of a subdata of a given DOP object.

• Returns the current time of a simulation.

• Returns a transformation matrix associated with a piece of data.

• Returns the simulation time equivalent to a given global time.

• Returns the velocity that a point at a location in simulation space would have if it were attached to a DOP object.

• Computes the dot product of two vectors.

• Channel segment function: ease-in and -out.

• Channel segment function: ease-in.

• Channel segment function: ease-in with configurable acceleration.

• Channel segment function: ease-out

• Channel segment function: ease-out with configurable acceleration.

• Channel segment function: ease-in and -out with configurable acceleration.

• Returns the list of edge groups in a surface node.

• Returns the list of edge groups matching a pattern in a surface node.

• Evaulates a string as an expression returning a float.

• Evaulates a string as an expression returning a string.

• Runs a string as an HScript command and returns the command’s output.

• Runs a string as an HScript command and returns the command and error output.

• Runs a string as an HScript command and returns any error output.

• Returns the logarithmic exponentiation of the argument.

• Explodes a 3×3 or 4×4 matrix into the euler rotations required to rebuild it.

• Explodes a 3×3 or 4×4 matrix into the euler rotations required to rebuild it.

• Explodes a 3×3 or 4×4 matrix into the euler rotations required to rebuild it.

• Searches the Houdini path for a file.

• Searches the Houdini path for a file or directory.

• Fits a value from one range to another.

• Fits a value to the 0-1 range.

• Fits a number in the 0-1 range.

• Fits a number to the -1 to 1 range.

• Returns the largest integer not greater than a number.

• Returns the fractional part of a floating-point number.

• Converts a number to a string.

• Returns a string describing the set of elements with a given value for an integer attribute.

• Returns a string describing the set of elements with a given value for a string attribute.

• Returns a non-zero value if the specified context option exists.

• Returns 1 if a specified detail attribute exists.

• Returns 1 if a specified point is in a specified group.

• Returns 1 if a specified point attribute exists.

• Returns 1 if a specified primitive is in a specified group.

• Returns 1 if a specified primitive attribute exists.

• Returns 1 if a specified vertex attribute exists.

• Converts a hexadecimal argument string into an integer.

• Converts RGB values to HSV components.

• Evaluates a CHOP’s input channel at a specific index.

• Returns the end index of a CHOP’s input.

• Returns the length of a CHOP’s input, in samples.

• Evaluates a CHOP’s input channel’s maximum value.

• Evaluates a CHOP’s input channel’s minimum value.

• Returns the number of channels in a CHOP’s input.

• Returns the sample rate of a CHOP’s input.

• Returns the start index of a CHOP’s input.

• Creates an identity matrix.

• Returns the value of the second or third argument depending on the truth of the first argument.

• Returns the string value of the second or third argument depending on the truth of the first argument.

• Finds the first occurrence of a pattern in a string.

• Returns the point number currently being instanced onto.

• Converts a number to an integer by truncating any fractional part.

• Converts a number into a hexadecimal string.

• Inverts a matrix.

• Queries numeric (floating point) data from an interactive render pane.

• Queries textual (string) data from an interactive render pane.

• Returns 1 if a primitive is closed.

• Returns 1 if a specified point has collided with something.

• Returns 1 if a specified Houdini environment variable exists.

• Returns 1 if a specified primitive is a NURBs or Bezier curve or surface.

• Returns 1 if a specified point is a stuck particle.

• Returns 1 if a specified Houdini or system environment variable exists.

• Returns 1 if a specified primitive is wrapped in U.

• Returns 1 if a specified primitive is wrapped in V.

• Returns the length of a vector.

• Channel segment function: linear interpolation.

• Returns a list of elements with a given value for an integer attribute.

• Returns a list of elements with a given value for a string attribute.

• Returns a value that cannot be changed.

• Returns the natural logarithm of the argument.

• Returns the base 10 logarithm of the argument.

• Returns the path of the USD primitive last modified by an input to a LOP node.

• Returns the paths of the USD primitives last modified by an input to a LOP node.

• Returns the path of the USD primitive last modified by a LOP node.

• Returns the paths of the USD primitives last modified by a LOP node.

• Channel segment function: matches the incoming and outgoing slopes.

• Channel segment function: matches the incoming slope.

• Channel segment function: matches the outgoing slope.

• Converts a string specification into a matrix.

• Converts a rotation matrix to a quaternion.

• Returns the larger of two values.

• Returns the number of columns in a matrix.

• Returns the weight of a metaball at a specific location.

• Returns the smaller of two values.

• Finds the smallest distance between a point and a primitive.

• Computes the transformation matrix of a lookat from one vector to another.

• Computes the transformation matrix of a lookat from one vector to another, with an up vector.

• Computes the transformation matrix of a lookat from one object to another.

• Blends the two modular values.

• Computes the transformation matrix to orient along specific Z and Y axes.

• Returns the full name of the pane currently under the mouse pointer.

• Returns the node path of the pane currently under the mouse pointer.

• Returns the number of rows in a matrix.

• Returns a matrix with all values set to 0.

• Finds the point in a geometry nearest to specific 3D coordinates.

• Generates 3D noise.

• Returns the components of the surface normal specific UV coordinates.

• Normalizes a vector.

• Returns the number of points in a geometry.

• Returns the number of points in the specified group.

• Returns the number of primitives in a surface node.

• Returns the number of primitives in the specified group.

• Returns the number of unique values for an integer or string attribute in a surface node.

• Returns the current global kinematic override setting for bone objects.

• Returns a list of lights matching an object’s light mask.

• Computes the rotation vector of a lookat from one object to another.

• Returns an object’s pre-transform matrix.

• Returns the value of a CHOP’s output at a specific sample index.

• Returns a pseudo-random number between 0 and 1.

• Returns the full paths of all operators in a bundle.

• Returns the creator of this node.

• Returns the numeric suffix of a node name.

• Returns 1 if the specified node, group, or bundle exists.

• Returns a list nodes with a particular flag set.

• Returns the full path of a node.

• Returns the path of a node relative to another node.

• Returns the unique ID of a node.

• Returns the name of the node connected to a given input.

• Returns the full path of the node connected to a given input.

• Returns 1 if Houdini is currently loading a scene file.

• Returns 1 if Houdini is currently shutting down.

• Returns a list of lights matching an object’s light mask.

• Sorts a list of node paths based on node input/outputs order.

• Returns the name of a node given its path.

• Returns the number of nodes inside a container node.

• Returns the maximum number of connected inputs.

• Returns the number of nodes connected to a node’s output.

• Returns the name of a node connected a given node’s output.

• Returns the full path of a node connected a given node’s output.

• Deprecated: replaced by opinput.

• Returns the path of the current network.

• Prints the path of the current network.

• Returns the relative path from one node to another.

• Returns a list of the selected nodes.

• Returns a list of the full paths of selected nodes.

• Returns a recursive list of the selected nodes.

• Returns a recursive list of the full paths of selected nodes.

• Computes the active stream of a node.

• Returns the full path of a node including any containing subnets.

• Returns the transformation matrix of an object at the current time.

• Returns the type of a node.

• Returns type information about a node.

• Returns components of an object’s transforms.

• Returns components of an object’s offset transforms.

• Returns a string padding a number to a given length with zeros.

• Deprecated: use stamp instead.

• Returns 1 if a specified parameter is a string.

• Returns the color of a pixel in a compositing node.

• Returns the non-interpolated color of a pixel in a compositing node.

• Converts an English noun to its plural.

• Returns the value of a point attribute.

• Returns the number of components in a point attribute.

• Returns the type of a point attribute.

• Returns the average of an attribute across all points in a geometry.

• Returns the distance between a point and a primitive.

• Returns the list of point groups in a surface node.

• Returns the list of point groups matching a pattern in a surface node.

• Returns a list of all points in a point group.

• Lists points that share a minimum number of primitives with a specified point.

• Returns a list of points that match a specified pattern.

• Returns the string value of a point attribute.

• Returns a string from a list of strings in a point attribute.

• Returns the number of unique strings bound to a point attribute.

• Returns the full path to a particle network context geometry.

• Returns 1 if a particle event is occurring.

• Returns the time of a particle event.

• Returns the value of a particle attribute, by particle number.

• Returns the value of a particle attribute, by particle ID.

• Returns the point number of the particle with the specified ID.

• Returns the string value of a particle attribute, by particle number.

• Returns the string value of a particle attribute, by particle ID.

• Raises a number to an exponent.

• Returns the value of a primitive attribute.

• Returns the number of components in a primitive attribute.

• Returns the type of a primitive attribute.

• Returns the minimum distance and closest points between two primitives.

• Returns the partial derivatives of a primitive attribute.

• Returns the list of primitive groups in a surface node.

• Returns the list of groups matching a pattern in a surface node.

• Returns a list of all primitives in a surface node.

• Lists primitives that share a minimum number of points with a specified primitive.

• Returns the string value of a primitive attribute.

• Returns a string from a list of strings in a primitive attribute.

• Returns the number of unique strings bound to a primitive attribute.

• Returns the value of a primitive attribute at a certain UV location.

• Prints a message to the console.

• Similar to ch(), but for render properties, with a default if the property doesn’t exist.

• Evaluates a render property at a given frame.

• Evaluates the string value of a render property at the current time.

• Evaluates a render property at the current time as a node path string.

• Evaluates the raw (unexpanded) string value of a render property at the current time.

• Evaluates a render property at a given time.

• Returns 1 when a value is within a certain range.

• Evaluates a Python expression, returning a float result.

• Evaluates a Python expression, returning a string result.

• Channel segment function: uses quaternions to interpolate.

• Converts quaternion to a 3×3 rotation matrix.

• Channel segment function: smoothly interpolates slopes and accelerations.

• Converts from degrees to radians.

• Returns a pseudo-random number from 0 to 1.

• Channel segment function.

• Converts unit UV to real UV.

• Channel segment function: repeats animation from previous frames.

• Channel segment function: repeats animation from previous frames.

• Returns the natural resolution of the image in a compositing node.

• Converts HSV values to RGB components.

• Finds the last occurrence of a pattern in a string.

• Rounds to the nearest integer.

• Returns a 4×4 rotation matrix from an axis and angle.

• Returns a 4×4 rotation matrix from an angle and a vector.

• Rounds a number to the nearest integer.

• Runs a string as an HScript command and returns the command’s output.

• Runs a string as an HScript command and returns the command and error output.

• Runs a string as an HScript command and returns any error output.

• Takes three scaling values and returns a scale matrix.

• Lists all seam points in a surface node.

• Returns 1 if a specified compositing node has an animated sequence.

• Returns the end frame of a compositing node’s image sequence.

• Returns the number of frames in a compositing node’s image sequence.

• Returns the start frame of a compositing node’s image sequence.

• Returns the shader string generated by a shader.

• Returns -1, 0, or 1 depending on the sign of the argument.

• Returns the sine of the argument.

• Returns the hyperbolic sine of the argument.

• Takes a value and range and returns a smooth interpolation between 0 and 1.

• Generates sparse convolution 3D noise.

• Returns a knot value on a spline curve or surface.

• Channel segment function: fits a curve to the keyframes.

• Returns the square root of the argument.

• Returns a copy stamping floating point value.

• Returns a copy stamping string value.

• Compares two strings, ignoring case.

• Returns 1 if a string matches a pattern, ignoring case.

• Returns the concatenation of two strings.

• Compares two strings.

• Duplicates a string.

• Strips non-essential characters from the string representation of a matrix or vector.

• Returns the number of characters in a string.

• Returns 1 if a string matches a pattern, including case.

• Replaces substrings with a new string.

• Generates spatially coherent 3D noise based on sparse convolution.

• Returns a substring of a string.

• Returns the length of the 3D curve between two points on a surface.

• Runs a system command line and returns the output.

• Runs a system command line and returns the exit status.

• Runs a system command line and returns the output with no processing.

• Returns the tangent of the argument.

• Returns the hyperbolic tangent of the argument.

• Returns the interpolated color of a point on an on-disk texture map.

• Returns the non-interpolated color of a point on an on-disk texture map.

• Returns the all-lowercase version of a string.

• Returns the result of evaluating the given expression in the current TOP context. There may be special local variables available depending on the parameter being evaluated.

• Returns the all-uppercase version of a string.

• Takes X, Y, and Z translation values and returns a translation matrix.

• Transposes a matrix.

• Converts a number to an integer by truncating any fractional part, rounding towards 0.

• Generates spatially coherent 3D noise.

• Returns a unique value of an integer attribute.

• Returns a unique value of a string attribute.

• Converts real UV to unit UV.

• Returns the distance between parameteric locations on two primitives.

• Returns the angle between two vectors.

• Converts a string specification into a vector.

• Converts three values into a 3-component vector.

• Converts four values into a 4-component vector.

• Returns the value of a vertex attribute.

• Returns the number of components in a vertex attribute.

• Returns the type of a vertex attribute.

• Returns the string value of a vertex attribute.

• Returns a string from a list of strings in a vertex attribute.

• Returns the number of unique strings bound to a point attribute.

• Returns the length of a vector.

• Channel segment function: matches the incoming and outgoing slopes.

• Channel segment function: matches the incoming slope.

• Channel segment function: matches the outgoing slope.

• Returns the average value of all the voxels in a volume.

• Returns the gradient of a volume primitive at a specified location.

• Returns the value of a volume primitive at a specified voxel.

• Converts volume voxel coordinates to world-space coordinates.

• Returns the maximum value of all voxels in a volume.

• Returns the minimum value of all voxels in a volume.

• Converts world space coordinates to volume voxel coordinates.

• Returns the resolution of a volume.

• Returns the value of a volume at a specified position.

• Returns the approximage diameter of a volume voxel in world space.

• Returns a vector of an objects' transforms.

• Takes a viewer name and a viewport number and returns the viewport’s name.

• Returns a vector of an object’s rotations.

• Multiplies a vector by a scaling factor.

• Creates a vector with each component set to the same value.

• Returns the number of elements in a vector.

• Returns a vector of an object’s translations.

• Wraps a value between a minimum and maximum.

• Returns the distance between a 3D coordinate and a primitive.

# Houdini 17.0

## Getting started

• New features and changes in Houdini 17.

• The basics of working with Houdini’s user interface.

• How to use and customize the icons on the shelf at the top of the main window.

• How to use the network and parameter editors to work in Houdini.

• Example files showing how different nodes work.

• How to use the online help and document your own tools.

## Using Houdini

• How Houdini represents geometry and how to create and edit it.

• How to use copies (real geometry) and instances (loaded or created at render time).

• How to create and keyframe animation in Houdini.

• How to rig and animate characters in Houdini.

• How to render images and animation from the 3D scene.

• How to assign materials and create custom materials for shading.

• Houdini’s compositing networks let you create and manipulate images such as renders.

• Digital assets let you create reusable nodes and tools from existing networks.

• How to get scene, object, and other data in and out of Houdini.

• Using Houdini’s stand-alone image viewer.

## Dynamics

• How to create particle simulations.

• How to use Houdini’s dynamics networks to create simulations.

• How to simulate smoke, fire, and explosions.

• How to set up fluid and ocean simulations.

• How to simulate grainy materials (such as sand).

• How to create and simulate crowds of characters in Houdini.

• How to create, style, and add dynamics to hair and fur.

• How to create and simulate deformable objects

## Nodes

• Object nodes represent objects in the scene, such as character parts, geometry objects, lights, cameras, and so on.

• Geometry nodes live inside Geo objects and generate geometry.

• Dynamics nodes set up the conditions and rules for dynamics simulations.

• VOP nodes let you define a program (such as a shader) by connecting nodes together. Houdini then compiles the node network into executable VEX code.

• Render nodes either render the scene or set up render dependency networks.

• Channel nodes create, filter, and manipulate channel data.

• Composite nodes create, filter, and manipulate image data.

## Reference

• Explains each of the items in the main menus.

• Viewer pane types.

• Documents the options in various panes.

• Documents the options in various user interface windows.

• Houdini includes a large number of useful command-line utility programs.

• How to script Houdini using Python and the Houdini Object Model.

• Expression functions let you compute the value of parameters.

• HScript is Houdini’s legacy scripting language.

• VEX is a high-performance expression language used in many places in Houdini, such as writing shaders.

• Properties let you set up flexible and powerful hierarchies of rendering, shading, lighting, and camera parameters.

• You can script custom pane types using Python to create your own UIs.

• Pre-made materials included with Houdini.