Expression functions

The old expression language is still available in Houdini for compatibility with older files and scripts. For new animations, we recommend you use the new HOM scripting architecture instead.

Subtopics

Clear

attributes

  • Returns the value of a detail attribute.
  • Returns the number of components in 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 1 if a specified detail attribute exists.
  • Returns 1 if a specified point attribute exists.
  • Returns 1 if a specified primtive attribute exists.
  • Returns 1 if a specified vertex attribute exists.
  • Returns the value of a point attribute.
  • Returns the number of components in a point attribute.
  • Returns the number of components in a primitive attribute.
  • Returns the number of components in a vertex attribute.

channels

  • Returns 1 if the specified channel exists, 0 if it doesn’t.
  • return a string containing all of the channels contained in a group.
  • Evaluates a channel within a CHOP at a given time.
  • Evaluates a channel within a CHOP at a specified sample point.

character

  • Returns the angle at the joint between two bone objects.
  • Returns the current global kinematic override setting for bone objects.

chops

  • Evaluates a channel within a CHOP at the current time.
  • 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 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.
  • ic
    Evaluates a CHOP’s input channel at a specific index.
  • ice
    Returns the end index of a CHOP’s input.
  • icl
    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.
  • icn
    Returns the number of channels in a CHOP’s input.
  • icr
    Returns the sample rate of a CHOP’s input.
  • ics
    Returns the start index of a CHOP’s input.
  • oc
    Returns the value of a CHOP’s output at a specific sample index.

color

  • hsv
    Converts RGB values to HSV components.
  • rgb
    Converts HSV values to RGB components.

dynamics

  • Returns a space separated list of all the field names that can be passed to the dopfield function.
  • 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.
  • 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.
  • Lists all seam points in a surface node.

files

  • Searches the Houdini path for a file.
  • Searches the Houdini path for a file or directory.

geometry

  • Returns bounding box information for a surface node.
  • Returns centroid information for a surface node.
  • Returns the curvature of the surface at the given UV coordinates.
  • Returns the degree a specified face or hull.
  • Returns the distance between two 3D points.
  • Returns 1 if a specified point is in a specified group.
  • Returns 1 if a specified primitive is in a specified group.
  • Returns 1 if a primitive is closed.
  • Returns 1 if a specified point has collided with something.
  • 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 primitive is wrapped in U.
  • Returns 1 if a specified primitive is wrapped in V.
  • Returns the weight of a metaball at a specific location.
  • Finds the smallest distance between a point and a primitive.
  • Finds the point in a geometry nearest to specific 3D coordinates.
  • Returns the components of the surface normal specific UV coordinates.
  • Returns the number of points in a geometry.
  • Returns the number of primitives in a surface node.
  • 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 value 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 primtives 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.
  • Converts unit UV to real UV.
  • Returns a knot value on a spline curve or surface.
  • Returns the length of the 3D curve between two points on a surface.
  • Converts real UV to unit UV.
  • Returns the distance between parameteric locations on two primitives.
  • Returns the value 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 distance between a 3D coordinate and a primitive.

images

  • pic
    Returns the color of a pixel in a compositing node.
  • Returns the non-interpolated color of a pixel in a compositing node.
  • res
    Returns the natural resolution of the image in a compositing 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.
  • tex
    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.

interface

  • Returns the full name of the pane currently under the mouse pointer.
  • Returns the node path of the pane currently under the mouse pointer.
  • Takes a viewer name and a viewport number and returns the viewport’s name.

math

  • abs
    Returns the absolute value of the argument.
  • Returns the arc-cosine of the argument.
  • Returns the arc length of a curve between two U positions.
  • Returns the arc-sine of the argument.
  • Returns the arc-tangent of the argument.
  • Returns the arc-tangent of y/x.
  • Returns the smallest integer not less than the value passed in.
  • Returns a value clamped between a minimum and maximum.
  • cos
    Returns the cosine of the argument.
  • Returns the hyperbolic cosine of the argument.
  • deg
    Converts from radians to degrees.
  • exp
    Returns the logarithmic exponentiation of the argument.
  • fit
    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.
  • int
    Converts a number to an integer by truncating any fractional part.
  • log
    Returns the natural logarithm of the argument.
  • Returns the base 10 logarithm of the argument.
  • max
    Returns the larger of two values.
  • min
    Returns the smaller of two values.
  • Blends the two modular values.
  • pow
    Raises a number to an exponent.
  • rad
    Converts from degrees to radians.
  • Rounds to the nearest integer.
  • Rounds a number to the nearest integer.
  • Returns -1, 0, or 1 depending on the sign of the argument.
  • sin
    Returns the sine of the argument.
  • Returns the hyperbolic sine of the argument.
  • Taks a value and range and returns a smooth interpolation between 0 and 1.
  • Returns the square root of the argument.
  • tan
    Returns the tangent of the argument.
  • Returns the hyperbolic tangent of the argument.
  • Converts a number to an integer by truncating any fractional part, rounding towards 0.
  • Wraps a value between a minimum and maximum.

matrices

  • Returns the determinant of a matrix.
  • Computes the dihedral matrix between vectors v0 and v1.
  • 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.
  • Creates an identity matrix.
  • Inverts a matrix.
  • Converts a string specification into a matrix.
  • Converts a rotation matrix to a quaternion.
  • Returns the number of columns in a matrix.
  • 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.
  • Computes the transformation matrix to orient along specific Z and Y axes.
  • Returns the number of rows in a matrix.
  • Returns a matrix with all values set to 0.
  • Converts quaternion to a 3×3 rotation matrix.
  • Returns a 4×4 rotation matrix from an axis and angle.
  • Returns a 4×4 rotation matrix from an angle and a vector.
  • Takes three scaling values and returns a scale matrix.
  • Takes X, Y, and Z translation values and returns a translation matrix.
  • Transposes a matrix.

nodes

  • 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 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.
  • Returns the relative path from one node to another.
  • Returns a list of the selected nodes.
  • Returns a recursive list of the selected nodes.
  • Returns the full path of a node including any containing subnets.
  • Returns the type of a node.
  • Returns type information about a node.

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 full paths of all operators in a bundle.
  • Returns a list of lights matching an object’s light mask.
  • Returns the transformation matrix of an object at the current time.
  • Returns components of an object’s transforms.
  • Returns components of an object’s offset transforms.

obsolete

  • 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.
  • Deprecated: Returns the type of a gadget on a custom panel.
  • Deprecated: replaced by opinput.
  • Deprecated: use stamp instead.

parameters

  • ch
    Returns the value of a parameter.
  • chf
    Evaluates a parameter at a given frame.
  • 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.
  • chs
    Evaluates the string value of a parameter at the current time.
  • Evaluates the parameter at the current time as a node path string.
  • Returns the raw expression value of a parameter as a string.
  • cht
    Returns the value of a parameter at a specified time.
  • Returns the point number currently being instanced onto.
  • Returns 1 if a specified parameter is a string.
  • Returns a copy stamping floating point value.
  • Returns a copy stamping string value.

particles

  • 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.

random

  • Generates 3D noise.
  • Returns a pseudo-random number between 0 and 1.
  • Returns a pseudo-random number from 0 to 1.
  • Generates sparse convolution 3D noise.
  • Generates spatially coherent 3D noise based on sparse convolution.
  • Generates spatially coherent 3D noise.

rendering

  • Queries numeric (floating point) data from an interactive render pane.
  • Queries textual (string) data from an interactive render pane.
  • Returns the shader string generated by a shader.

segments

  • Channel segment function: Bezier interpoloation spline
  • Channel segment function: constant value.
  • Channel segment function: cubic spline.
  • Channel segment function: repeats the animation between frames f1 and f2.
  • Channel segment function: repeats the animation between times t1 and t2.
  • 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.
  • Channel segment function: linear interpolation.
  • Channel segment function: matches the incoming and outgoing slopes.
  • Channel segment function: matches the incoming slope.
  • Channel segment function: matches the outgoing slope.
  • Channel segment function: uses quaternions to interpolate.
  • Channel segment function: smoothly interpolates slopes and accelerations.
  • raw
    Channel segment function.
  • Channel segment function: repeats animation from previous frames.
  • Channel segment function: repeats animation from previous frames.
  • Channel segment function: fits a curve to the keyframes.
  • Channel segment function: matches the incoming and outgoing slopes.
  • Channel segment function: matches the incoming slope.
  • Channel segment function: matches the outgoing slope.

strings

  • Converts a number to a string.
  • Finds the first occurrence of a pattern in a string.
  • Finds the last occurrence of a pattern in a string.
  • 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.
  • Returns a substring of a string.
  • Returns the all-lowercase version of a string.
  • Returns the all-uppercase version of a string.

utility

  • arg
    Returns an argument from a list of HScript-style arguments.
  • Returns the number of arguments in an HScript-style list of arguments.
  • Converts a string to a float.
  • 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.
  • Converts a hexadecimal argument string into an integer.
  • if
    Returns the value of the second or third argument depending on the truth of the first argument.
  • ifs
    Returns the string value of the second or third argument depending on the truth of the first argument.
  • Converts a number into a hexadecimal string.
  • Returns 1 if a specified Houdini environment variable exists.
  • Returns 1 if a specified Houdini or system environment variable exists.
  • Returns a value that cannot be changed.
  • Returns 1 if Houdini is currently shutting down.
  • Returns the path of the current network.
  • Prints the path of the current network.
  • Returns a string padding a number to a given length with zeros.
  • Prints a message to the console.
  • 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.
  • run
    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.
  • Runs a system command line and returns the output.
  • Runs a system command line and returns the exit status.

vectors

  • Returns the angular velocity required to rotate an object from one orientation to another in a certain period of time.
  • Clamps a vector to always end between a minimum and maximum sphere.
  • Computes the cross-product of two vectors.
  • dot
    Computes the dot product of two vectors.
  • Returns the length of a vector.
  • Normalizes a vector.
  • 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 length of a vector.
  • Returns a vector of a objects’s transforms.
  • 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.

volumes

  • 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.