Houdini 17.0 VEX VEX contexts

sop VEX context

Obsolete. Define a custom SOP operator with a program that edits geometry point attributes.

On this page

Warning

This context is obsolete and no longer used in Houdini. VEX that manipulates geometry now executes in the more generic CVEX context.

Globals

vector P

Position of the current point.

float Pw

Point weight.

vector v

Velocity of the current point.

vector accel

Acceleration of the current point.

float age

Age of the current point (how many seconds a particle has been alive).

float life

Expected lifetime (in seconds) of the current point.

int pstate

State of the current particle. This is an integer bit field with the following flags:

0x01

Is a "primary" particle (not birthed from an existing particle).

0x02

Will die before the next frame.

0x04

Stopped.

0x08

Has collided.

0x10

Stuck to static or moving geometry.

0x20

Is associated with a rigid body dynamic simulation.

0x40

Active.

0x80

Motion is overridden by a CHOP.

int id

ID attribute.

int ptnum Read only

Point number of the point being processed.

vector Cd

Color (RGB) of the current point.

vector N

Point normal.

int Npt Read only

Total number of points geometry.

float Time Read only

Current time (in seconds).

float Frame Read only

Current frame. This may not be an integer value.

float TimeInc Read only

Time increment between frames (SOP context)/Time increment for particle simulations (POP context).

Functions

  • Du

    Returns the derivative of the given value with respect to U.

  • Dv

    Returns the derivative of the given value with respect to V.

  • Dw

    Returns the derivative of the given value with respect to the 3rd axis (for volume rendering).

  • abs

    Returns the absolute value of the argument.

  • acos

    Returns the inverse cosine of the argument.

  • addattrib

    Adds an attribute to a geometry.

  • adddetailattrib

    Adds a detail attribute to a geometry.

  • addpoint

    Adds a point to the geometry.

  • addpointattrib

    Adds a point attribute to a geometry.

  • addprim

    Adds a primitive to the geometry.

  • addprimattrib

    Adds a primitive attribute to a geometry.

  • addvariablename

    Adds a mapping for an attribute to a local variable.

  • addvertex

    Adds a vertex to a primitive in a geometry.

  • addvertexattrib

    Adds a vertex attribute to a geometry.

  • addvisualizer

    Appends to a geometry’s visualizer detail attribute.

  • agentaddclip

    Add a clip into an agent’s definition.

  • agentclipcatalog

    Returns all of the animation clips that have been loaded for an agent primitive.

  • agentclipchannel

    Finds the index of a channel in an agent’s animation clip.

  • agentcliplength

    Returns the length (in seconds) of an agent’s animation clip.

  • agentclipnames

    Returns an agent primitive’s current animation clips.

  • agentclipsample

    Samples a channel of an agent’s clip at a specific time.

  • agentclipsamplelocal

    Samples an agent’s animation clip at a specific time.

  • agentclipsamplerate

    Returns the sample rate of an agent’s animation clip.

  • agentclipsampleworld

    Samples an agent’s animation clip at a specific time.

  • agentcliptimes

    Returns the current times for an agent primitive’s animation clips.

  • agentcliptransformgroups

    Returns the transform groups for an agent primitive’s current animation clips.

  • agentclipweights

    Returns the blend weights for an agent primitive’s animation clips.

  • agentcollisionlayer

    Returns the name of the collision layer of an agent primitive.

  • agentcurrentlayer

    Returns the name of the current layer of an agent primitive.

  • agentfindtransformgroup

    Finds the index of a transform group in an agent’s definition.

  • agentlayerbindings

    Returns the transform that each shape in an agent’s layer is bound to.

  • agentlayers

    Returns all of the layers that have been loaded for an agent primitive.

  • agentlayershapes

    Returns the names of the shapes referenced by an agent primitive’s layer.

  • agentlocaltransform

    Returns the current local space transform of an agent primitive’s bone.

  • agentlocaltransforms

    Returns the current local space transforms of an agent primitive.

  • agentrigchildren

    Returns the child transforms of a transform in an agent primitive’s rig.

  • agentrigfind

    Finds the index of a transform in an agent primitive’s rig.

  • agentrigparent

    Returns the parent transform of a transform in an agent primitive’s rig.

  • agentsolvefbik

    Applies a full-body inverse kinematics algorithm to an agent’s skeleton.

  • agenttransformcount

    Returns the number of transforms in an agent primitive’s rig.

  • agenttransformgroupmember

    Returns whether a transform is a member of the specified transform group.

  • agenttransformgroups

    Returns the names of the transform groups in an agent’s definition.

  • agenttransformgroupweight

    Returns the weight of a member of the specified transform group.

  • agenttransformnames

    Returns the name of each transform in an agent primitive’s rig.

  • agenttransformtolocal

    Converts transforms from world space to local space for an agent primitive.

  • agenttransformtoworld

    Converts transforms from local space to world space for an agent primitive.

  • agentworldtransform

    Returns the current world space transform of an agent primitive’s bone.

  • agentworldtransforms

    Returns the current world space transforms of an agent primitive.

  • albedo

    Returns the albedo (percentage of reflected light) for a bsdf given the outgoing light direction.

  • anoise

    Generates "alligator" noise.

  • append

    Adds an item to an array or string.

  • area

    Returns the area of the micropolygon containing a variable such as P.

  • argsort

    Returns the indices of a sorted version of an array.

  • array

    Efficiently creates an array from its arguments.

  • ashikhmin

    Returns a specular BSDF using the Ashikhmin shading model.

  • asin

    Returns the inverse sine of the argument.

  • assert_enabled

    Returns 1 if the VEX assertions are enabled (see HOUDINI_VEX_ASSERT) or 0 if assertions are disabled. Used the implement the assert macro.

  • assign

    An efficient way of extracting the components of a vector or matrix into float variables.

  • atan

    Returns the inverse tangent of the argument.

  • atan2

    Returns the inverse tangent of y/x.

  • atof

    Converts a string to a float.

  • atoi

    Converts a string to an integer.

  • atten

    Computes attenuated falloff.

  • attrib

    Reads the value of an attribute from geometry.

  • attribclass

    Returns the class of a geometry attribute.

  • attribdataid

    Returns the data id of a geometry attribute.

  • attribsize

    Returns the size of a geometry attribute.

  • attribtype

    Returns the type of a geometry attribute.

  • attribtypeinfo

    Returns the transformation metadata of a geometry attribute.

  • avg

    Returns the average value of the input(s)

  • blackbody

    Compute the color value of an incandescent black body.

  • blinn

    Returns a Blinn BSDF or computes Blinn shading.

  • blinnBRDF

  • bouncelabel

  • bouncemask

  • cbrt

    Returns the cube root of the argument.

  • ceil

    Returns the smallest integer greater than or equal to the argument.

  • ch

    Evaluates a channel (or parameter) and return its value.

  • ch2

    Evaluates a channel (or parameter) and return its value.

  • ch3

    Evaluates a channel (or parameter) and return its value.

  • ch4

    Evaluates a channel (or parameter) and return its value.

  • chexpr

    Evaluates a channel with a new segment expression.

  • chexprf

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

  • chexprt

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

  • chf

    Evaluates a channel (or parameter) and return its value.

  • chi

    Evaluates a channel (or parameter) and return its value.

  • chop

    Returns the value of a CHOP channel at the specified sample.

  • chopt

    Returns the value of a CHOP channel at the specified sample and evaluation time.

  • chp

    Evaluates a channel (or parameter) and return its value.

  • chr

    Converts an unicode codepoint to a UTF8 string.

  • chramp

    Evaluates a ramp parameter and return its value.

  • chs

    Evaluates a channel (or parameter) and return its value.

  • chsraw

    Returns the raw string channel (or parameter).

  • chu

    Evaluates a channel or parameter, and return its value.

  • chv

    Evaluates a channel or parameter, and return its value.

  • ckspline

    Samples a Catmull-Rom (Cardinal) spline defined by position/value keys.

  • clamp

    Returns value clamped between min and max.

  • clip

    Clip the line segment between p0 and p1.

  • colormap

    Looks up a (filtered) color from a texture file.

  • computenormal

    In shading contexts, computes a normal. In the SOP contexts, sets how/whether to recompute normals.

  • concat

    Concatenate all the strings specified to form a single string.

  • cone

    Returns a cone reflection BSDF.

  • cos

    Returns the cosine of the argument.

  • cosh

    Returns the hyperbolic cosine of the argument.

  • cracktransform

    Depending on the value of c, returns the translate (c=0), rotate (c=1), scale (c=2), or shears (c=3) component of the transform (xform).

  • create_cdf

    Creates a CDF from an array of input PDF values.

  • create_pdf

    Creates a PDF from an array of input values.

  • cross

    Returns the cross product between the two vectors.

  • cspline

    Samples a Catmull-Rom (Cardinal) spline defined by uniformly spaced keys.

  • ctransform

    Transforms between color spaces.

  • curlnoise

    Computes divergence free noise based on Perlin noise.

  • curlnoise2d

    Computes 2d divergence free noise based on Perlin noise.

  • curlxnoise

    Computes divergence free noise based on Simplex noise.

  • curlxnoise2d

    Computes 2d divergence free noise based on simplex noise.

  • cvex_bsdf

    Creates a bsdf object from two CVEX shader strings.

  • cwnoise

    Generates Worley (cellular) noise using a Chebyshev distance metric.

  • degrees

    Converts the argument from radians into degrees.

  • depthmap

    The depthmap functions work on an image which was rendered as a z-depth image from mantra.

  • detail

    Reads the value of a detail attribute value from a geometry.

  • detailattrib

    Reads a detail attribute value from a geometry.

  • detailattribsize

    Returns the size of a geometry detail attribute.

  • detailattribtype

    Returns the type of a geometry detail attribute.

  • detailattribtypeinfo

    Returns the type info of a geometry attribute.

  • detailintrinsic

    Reads the value of a detail intrinsic from a geometry.

  • determinant

    Computes the determinant of the matrix.

  • diagonalizesymmetric

    Diagonalizes Symmetric Matrices.

  • diffuse

    Returns a diffuse BSDF or computes diffuse shading.

  • diffuseBRDF

  • dihedral

    Computes the rotation matrix or quaternion which rotates the vector a onto the vector b.

  • distance

    Returns the distance between two points.

  • distance2

    Returns the squared distance between the two points.

  • dot

    Returns the dot product between the arguments.

  • dsmpixel

    Reads the z-records stored in a pixel of a deep shadow map or deep camera map.

  • efit

    Takes the value in one range and shifts it to the corresponding value in a new range.

  • eigenvalues

    Computes the eigenvalues of a 3×3 matrix.

  • endswith

    Indicates the string ends with the specified string.

  • environment

    Returns the color of the environment texture.

  • erf

    Gauss error function.

  • erf_inv

    Inverse Gauss error function.

  • erfc

    Gauss error function’s complement.

  • error

    Reports a custom runtime VEX error.

  • eulertoquaternion

    Creates a vector4 representing a quaternion from euler angles.

  • eval_bsdf

    Evaluates a bsdf given two vectors.

  • exp

    Returns the exponential function of the argument.

  • expand_udim

    Perform UDIM or UVTILE texture filename expansion.

  • expandedgegroup

  • expandpointgroup

  • expandprimgroup

  • expandvertexgroup

  • filamentsample

    Samples the velocity field defined by a set of vortex filaments.

  • file_stat

    Returns file system status for a given file.

  • filterstep

    Returns the anti-aliased weight of the step function.

  • find

    Finds an item in an array or string.

  • findattribval

    Finds a primitive/point/vertex that has a certain attribute value.

  • findattribvalcount

    Returns number of elements where an integer or string attribute has a certain value.

  • fit

    Takes the value in one range and shifts it to the corresponding value in a new range.

  • fit01

    Takes the value in the range (0, 1) and shifts it to the corresponding value in a new range.

  • fit10

    Takes the value in the range (1, 0) and shifts it to the corresponding value in a new range.

  • fit11

    Takes the value in the range (-1, 1) and shifts it to the corresponding value in a new range.

  • floor

    Returns the largest integer less than or equal to the argument.

  • flownoise

    Generates 1D and 3D Perlin Flow Noise from 3D and 4D data.

  • flowpnoise

    There are two forms of Perlin-style noise: a non-periodic noise which changes randomly throughout N-dimensional space, and a periodic form which repeats over a given range of space.

  • frac

    Returns the fractional component of the floating point number.

  • fresnel

    Computes the fresnel reflection/refraction contributions given an incoming vector, surface normal (both normalized), and an index of refraction (eta).

  • fromNDC

    Transforms a position from normal device coordinates to the coordinates in the appropriate space.

  • frontface

    If dot(I, Nref) is less than zero, N will be negated.

  • fuzzify

  • fuzzy_and

  • fuzzy_defuzz_centroid

  • fuzzy_nand

  • fuzzy_nor

  • fuzzy_not

  • fuzzy_nxor

  • fuzzy_or

  • fuzzy_xor

  • geoself

    Returns a handle to the current geometry.

  • geounwrap

    Returns an oppath: string to unwrap the geometry in-place.

  • getattrib

    Reads an attribute value from geometry, with validity check.

  • getattribute

    Copies the value of a geometry attribute into a variable and returns a success flag.

  • getbbox

    Sets two vectors to the minimum and maximum corners of the bounding box for the geometry.

  • getbbox_center

    Returns the center of the bounding box for the geometry.

  • getbbox_max

    Returns the maximum of the bounding box for the geometry.

  • getbbox_min

    Returns the minimum of the bounding box for the geometry.

  • getbbox_size

    Returns the size of the bounding box for the geometry.

  • getbounces

  • getbounds

    Returns the bounding box of the geometry specified by the filename.

  • getcomp

    Extracts a single component of a vector type, matrix type, or array.

  • getpackedtransform

    Gets the transform of a packed primitive.

  • getpointbbox

    Sets two vectors to the minimum and maximum corners of the bounding box for the geometry.

  • getpointbbox_center

    Returns the center of the bounding box for the geometry.

  • getpointbbox_max

    Returns the maximum of the bounding box for the geometry.

  • getpointbbox_min

    Returns the minimum of the bounding box for the geometry.

  • getpointbbox_size

    Returns the size of the bounding box for the geometry.

  • getspace

    Returns a transform from one space to another.

  • gradient

    Returns the gradient of a field.

  • hair

    Returns a BSDF for shading hair.

  • hasattrib

    Checks whether a geometry attribute exists.

  • hasdetailattrib

    Returns if a geometry detail attribute exists.

  • haspointattrib

    Returns if a geometry point attribute exists.

  • hasprimattrib

    Returns if a geometry prim attribute exists.

  • hasvertexattrib

    Returns if a geometry vertex attribute exists.

  • hedge_dstpoint

    Returns the destination point of a half-edge.

  • hedge_dstvertex

    Returns the destination vertex of a half-edge.

  • hedge_equivcount

    Returns the number of half-edges equivalent to a given half-edge.

  • hedge_isequiv

    Determines whether a two half-edges are equivalent (represent the same edge).

  • hedge_isprimary

    Determines whether a half-edge number corresponds to a primary half-edge.

  • hedge_isvalid

    Determines whether a half-edge number corresponds to a valid half-edge.

  • hedge_next

    Returns the half-edge that follows a given half-edge in its polygon.

  • hedge_nextequiv

    Returns the next half-edges equivalent to a given half-edge.

  • hedge_postdstpoint

    Returns the point into which the vertex following the destination vertex of a half-edge in its primitive is wired.

  • hedge_postdstvertex

    Returns the vertex following the destination vertex of a half-edge in its primitive.

  • hedge_presrcpoint

    Returns the point into which the vertex that precedes the source vertex of a half-edge in its primitive is wired.

  • hedge_presrcvertex

    Returns the vertex that precedes the source vertex of a half-edge in its primitive.

  • hedge_prev

    Returns the half-edge that precedes a given half-edge in its polygon.

  • hedge_prim

    Returns the primitive that contains a half-edge.

  • hedge_primary

    Returns the primary half-edge equivalent to a given half-edge.

  • hedge_srcpoint

    Returns the source point of a half-edge.

  • hedge_srcvertex

    Returns the source vertex of a half-edge.

  • henyeygreenstein

    Returns an anisotropic volumetric BSDF, which can scatter light forward or backward.

  • hscript_noise

    Generates noise matching the output of the Hscript noise() expression function.

  • hscript_rand

    Produces the exact same results as the Houdini expression function of the same name.

  • hscript_snoise

  • hscript_sturb

  • hscript_turb

    Generates turbulence matching the output of the HScript turb() expression function.

  • hsvtorgb

    Convert HSV color space into RGB color space.

  • ident

    Returns an identity matrix.

  • idtopoint

    Finds a point by its id attribute.

  • idtoprim

    Finds a primitive by its id attribute.

  • inedgegroup

    Returns 1 if the edge specified by the point pair is in the group specified by the string.

  • inpointgroup

    Returns 1 if the point specified by the point number is in the group specified by the string.

  • inprimgroup

    Returns 1 if the primitive specified by the primitive number is in the group specified by the string.

  • insert

    Inserts an item, array, or string into an array or string.

  • instance

    Creates an instance transform matrix.

  • interpolate

    Interpolates a value across the currently shaded micropolygon.

  • intersect

    This function computes the first intersection of a ray with geometry.

  • intersect_all

    Computes all intersections of the specified ray with geometry.

  • invert

    Inverts a matrix.

  • invertexgroup

    Returns 1 if the vertex specified by the vertex number is in the group specified by the string.

  • isalpha

    Returns 1 if all the characters in the string are alphabetic

  • isbound

    Parameters in VEX can be overridden by geometry attributes (if the attributes exist on the surface being rendered).

  • isconnected

    Returns 1 if input_number is connected, or 0 if the input is not connected.

  • isdigit

    Returns 1 if all the characters in the string are numeric

  • isfinite

    Checks whether a value is a normal finite number.

  • isnan

    Checks whether a value is not a number.

  • isotropic

    Returns an isotropic BSDF, which scatters light equally in all directions.

  • isvalidindex

    Checks if the index given is valid for the array or string given.

  • isvarying

    Check whether a VEX variable is varying or uniform.

  • itoa

    Converts an integer to a string.

  • join

    Concatenate all the strings of an array inserting a common spacer.

  • kspline

    Returns an interpolated value along a curve defined by a basis and key/position pairs.

  • len

    Returns the length of an array.

  • length

    Returns the magnitude of a vector.

  • length2

    Returns the squared distance of the vector or vector4.

  • lerp

    Performs bilinear interpolation between the values.

  • limit_sample_space

    Limits a unit value in a way that maintains uniformity and in-range consistency.

  • lkspline

    Samples a polyline between the key points.

  • log

    Returns the natural logarithm of the argument.

  • log10

    Returns the logarithm (base 10) of the argument.

  • lookat

    Computes a rotation matrix or angles to orient the z-axis along the vector (to-from) under the transformation.

  • lspline

    Samples a polyline defined by linearly spaced values.

  • lstrip

    Strips leading whitespace from a string.

  • luminance

    Compute the luminance of the RGB color specified by the parameters.

  • makebasis

    Creates an orthonormal basis given a z-axis vector.

  • maketransform

    Builds a 3×3 or 4×4 transform matrix.

  • mask_bsdf

    Returns new BSDF that only includes the components specified by the mask.

  • match

    This function returns 1 if the subject matches the pattern specified, or 0 if the subject doesn’t match.

  • matchvex_blinn

    Returns a BSDF that matches the output of the traditional VEX blinn function.

  • matchvex_specular

    Returns a BSDF that matches the output of the traditional VEX specular function.

  • max

  • metaimport

    Once you get a handle to a metaball using metastart and metanext, you can query attributes of the metaball with metaimport.

  • metamarch

    Takes the ray defined by p0 and p1 and partitions it into zero or more sub-intervals where each interval intersects a cluster of metaballs from filename.

  • metanext

    Iterate to the next metaball in the list of metaballs returned by the metastart() function.

  • metastart

    Open a geometry file and return a "handle" for the metaballs of interest, at the position p.

  • metaweight

    Returns the metaweight of the geometry at position p.

  • min

  • minpos

    Finds the closest position on the surface of a geometry.

  • mwnoise

    Generates Worley (cellular) noise using a Manhattan distance metric.

  • nametopoint

    Finds a point by its name attribute.

  • nametoprim

    Finds a primitive by its name attribute.

  • nbouncetypes

  • nearpoint

    Finds the closest point in a geometry.

  • nearpoints

    Finds the all the closest point in a geometry.

  • nedgesgroup

    Returns the number of edges in the group.

  • neighbour

    Returns the point number of the next point connected to a given point.

  • neighbourcount

    Returns the number of points that are connected to the specified point.

  • neighbours

    Returns an array of the point numbers of the neighbours of a point.

  • noise

    There are two forms of Perlin-style noise: a non-periodic noise which changes randomly throughout N-dimensional space, and a periodic form which repeats over a given range of space.

  • noised

    Derivatives of Perlin Noise.

  • normal_bsdf

    Returns the normal for the diffuse component of a BSDF.

  • normalize

    Returns a normalized vector.

  • npoints

    Returns the number of points in the input or geometry file.

  • npointsgroup

    Returns the number of points in the group.

  • nprimitives

    Returns the number of primitives in the input or geometry file.

  • nprimitivesgroup

    Returns the number of primitives in the group.

  • nrandom

    Non-deterministic random number generation function.

  • ntransform

    Transforms a normal vector.

  • nuniqueval

    Returns the number of unique values from an integer or string attribute.

  • nvertices

    Returns the number of vertices in the input or geometry file.

  • nverticesgroup

    Returns the number of vertices in the group.

  • ocean_sample

    Evaluates an ocean spectrum and samples the result at a given time and location.

  • ocio_activedisplays

    Returns the names of active displays supported in Open Color IO

  • ocio_activeviews

    Returns the names of active views supported in Open Color IO

  • ocio_import

    Imports attributes from OpenColorIO spaces.

  • ocio_roles

    Returns the names of roles supported in Open Color IO

  • ocio_spaces

    Returns the names of color spaces supported in Open Color IO.

  • ocio_transform

    Transform colors using Open Color IO

  • onoise

    These functions are similar to wnoise and vnoise.

  • opdigits

    Returns the integer value of the last sequence of digits of a string

  • opfullpath

    Returns the full path for the given relative path

  • opparentbonetransform

    Returns the parent bone transform associated with an OP.

  • opparenttransform

    Returns the parent transform associated with an OP.

  • opparmtransform

    Returns the parm transform associated with an OP.

  • oppreconstrainttransform

    Returns the preconstraint transform associated with an OP.

  • oppretransform

    Returns the pretransform associated with an OP.

  • optransform

    Returns the transform associated with an OP.

  • ord

    Converts an UTF8 string into a codepoint.

  • osd_facecount

  • osd_firstpatch

  • osd_limitsurface

    Evaluates an attribute at the subdivision limit surface using Open Subdiv.

  • osd_limitsurfacevertex

  • osd_lookupface

    Outputs the Houdini face and UV coordinates corresponding to the given coordinates on an OSD patch.

  • osd_lookuppatch

    Outputs the OSD patch and UV coordinates corresponding to the given coordinates on a Houdini polygon face.

  • osd_patchcount

  • osd_patches

    Returns a list of patch IDs for the patches in a subdivision hull.

  • outerproduct

    Returns the outer product between the arguments.

  • ow_nspace

    Transforms a normal vector from Object to World space.

  • ow_space

    Transforms a position value from Object to World space.

  • ow_vspace

    Transforms a direction vector from Object to World space.

  • pack_inttosafefloat

    Reversibly packs an integer into a finite, non-denormal float.

  • packedtransform

    Transforms a packed primitive.

  • pcclose

    This function closes the handle associated with a pcopen function.

  • pcconvex

  • pcexport

    Writes data to a point cloud inside a pciterate or a pcunshaded loop.

  • pcfarthest

    Returns the distance to the farthest point found in the search performed by pcopen.

  • pcfilter

    Filters points found by pcopen using a simple reconstruction filter.

  • pcfind

    Returns a list of closest points from a file.

  • pcfind_radius

    Returns a list of closest points from a file taking into account their radii.

  • pcgenerate

    Generates a point cloud.

  • pcimport

    Imports channel data from a point cloud inside a pciterate or a pcunshaded loop.

  • pcimportbyidx3

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidx4

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidxf

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidxi

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidxp

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidxs

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pcimportbyidxv

    Imports channel data from a point cloud outside a pciterate or a pcunshaded loop.

  • pciterate

    This function can be used to iterate over all the points which were found in the pcopen query.

  • pcnumfound

    This node returns the number of points found by pcopen.

  • pcopen

    Returns a handle to a point cloud file.

  • pcopenlod

    Returns a handle to a point cloud file.

  • pcsampleleaf

    Changes the current iteration point to a leaf descendant of the current aggregate point.

  • pcsize

  • pcunshaded

    Iterate over all of the points of a read-write channel which haven’t had any data written to the channel yet.

  • pcwrite

    Writes data to a point cloud file.

  • pgfind

    Returns a list of closest points from a file.

  • phongBRDF

  • phonglobe

  • photonmap

    Samples a color from a photon map.

  • planepointdistance

    Computes the distance and closest point of a point to an infinite plane.

  • planesphereintersect

    Computes the intersection of a 3D sphere and an infinite 3D plane.

  • pluralize

    Converts an English noun to its plural.

  • pnoise

    There are two forms of Perlin-style noise: a non-periodic noise which changes randomly throughout N-dimensional space, and a periodic form which repeats over a given range of space.

  • point

    Reads a point attribute value from a geometry.

  • pointattrib

    Reads a point attribute value from a geometry and outputs a success/fail flag.

  • pointattribsize

    Returns the size of a geometry point attribute.

  • pointattribtype

    Returns the type of a geometry point attribute.

  • pointattribtypeinfo

    Returns the type info of a geometry attribute.

  • pointedge

    Finds and returns a half-edge with the given endpoints.

  • pointhedge

    Finds and returns a half-edge with a given source point or with given source and destination points.

  • pointhedgenext

    Returns the next half-edge with the same source as a given half-edge.

  • pointprims

    Returns the list of primitives containing a point.

  • pointvertex

    Returns a linear vertex number of a point in a geometry.

  • pointvertices

    Returns the list of vertices connected to a point.

  • polardecomp

    Computes the polar decomposition of a matrix.

  • polyneighbours

    Returns an array of the primitive numbers of the edge-neighbours of a polygon.

  • pop

    Removes the last element of an array and returns it.

  • pow

    Raises the first argument to the power of the second argument.

  • predicate_incircle

    Determines if a point is inside or outside a triangle circumcircle.

  • predicate_insphere

    Determines if a point is inside or outside a tetrahedron circumsphere.

  • predicate_orient2d

    Determines the orientation of a point with respect to a line.

  • predicate_orient3d

    Determines the orientation of a point with respect to a plane.

  • prim

    Reads a primitive attribute value from a geometry.

  • prim_attribute

    Interpolates the value of an attribute at a certain parametric (u, v) position and copies it into a variable.

  • prim_normal

    Returns the normal of the primitive (prim_number) at parametric location u, v.

  • primarclen

    Evaluates the length of an arc on a primitive using parametric uv coordinates.

  • primattrib

    Reads a primitive attribute value from a geometry, outputting a success flag.

  • primattribsize

    Returns the size of a geometry prim attribute.

  • primattribtype

    Returns the type of a geometry prim attribute.

  • primattribtypeinfo

    Returns the type info of a geometry attribute.

  • primduv

    Returns position derivative on a primitive at a certain parametric (u, v) position.

  • primfind

    Returns a list of primitives potentially intersecting a given bounding box.

  • primhedge

    Returns one of the half-edges contained in a primitive.

  • primintrinsic

    Reads a primitive intrinsic from a geometry.

  • primpoint

    Converts a primitive/vertex pair into a point number.

  • primpoints

    Returns the list of points on a primitive.

  • primuv

    Interpolates the value of an attribute at a certain parametric (uvw) position.

  • primuvconvert

    Convert parametric UV locations on curve primitives between different spaces.

  • primvertex

    Converts a primitive/vertex pair into a linear vertex.

  • primvertexcount

    Returns number of vertices in a primitive in a geometry.

  • primvertices

    Returns the list of vertices on a primitive.

  • print_once

    Prints a message only once, even in a loop.

  • printf

    Prints values to the console which started the VEX program.

  • product

    Returns the product of a list of numbers.

  • ptexture

    Computes a filtered sample from a ptex texture map. Use texture instead.

  • ptlined

    This function returns the closest distance between the point Q and a finite line segment between points P0 and P1.

  • ptransform

    Transforms a vector from one space to another.

  • push

    Adds an item to an array.

  • xnoise

    Simplex noise is very close to Perlin noise, except with the samples on a simplex mesh rather than a grid. This results in less grid artifacts. It also uses a higher order bspline to provide better derivatives. This is the periodic simplex noise

  • pxnoised

    Periodic derivatives of Simplex Noise.

  • qconvert

    Converts a quaternion represented by a vector4 to a matrix3 representation.

  • qdistance

    Finds distance between two quaternions.

  • qinvert

    Inverts a quaternion rotation.

  • qmultiply

    Multiplies two quaternions and returns the result.

  • qrotate

    Rotates a vector by a quaternion.

  • quaternion

    Creates a vector4 representing a quaternion.

  • quaterniontoeuler

    Creates a euler angle representing a quaternion.

  • radians

    Converts the argument from degrees into radians.

  • rand

    Creates a random number between 0 and 1 from a seed.

  • random

    Generate a random number based on the position in 1-4D space.

  • random_fhash

    Hashes floating point numbers to integers.

  • random_ihash

    Hashes integer numbers to integers.

  • random_poisson

    Generates a random Poisson variable given the mean to the distribution and a seed.

  • random_shash

    Hashes a string to an integer.

  • random_sobol

    Generate a uniformly distributed random number.

  • rawcolormap

    Looks up an unfiltered color from a texture file.

  • re_find

    Matches a regular expression in a string

  • re_findall

    Finds all instances of the given regular expression in the string

  • re_match

    Returns 1 if the entire input string matches the expression

  • re_replace

    Replaces instances of regex_find with regex_replace

  • re_split

    Splits the given string based on regex match.

  • reflect

    Returns the vector representing the reflection of the direction against the normal.

  • refract

    Returns the refraction ray given an incoming direction, the normalized normal and an index of refraction.

  • relativepath

    Computes the relative path for two full paths.

  • relbbox

    Returns the relative position of the point given with respect to the bounding box of the geometry.

  • relpointbbox

    Returns the relative position of the point given with respect to the bounding box of the geometry.

  • removeindex

    Removes an item at the given index from an array.

  • removepoint

    Removes a point from the geometry.

  • removeprim

    Removes a primitive from the geometry.

  • removevalue

    Removes an item from an array.

  • reorder

    Reorders items in an array or string.

  • resample_linear

  • resize

    Sets the length of an array.

  • reverse

    Returns an array or string in reverse order.

  • rgbtohsv

    Convert RGB color space to HSV color space.

  • rgbtoxyz

    Convert a linear sRGB triplet to CIE XYZ tristimulus values.

  • rint

    Rounds the number to the closest whole number.

  • rotate

    Applies a rotation to the given matrix.

  • rotate_x_to

    Rotates a vector by a rotation that would bring the x-axis to a given direction.

  • rstrip

    Strips trailing whitespace from a string.

  • sample_bsdf

    Samples a BSDF.

  • sample_cauchy

    Samples the Cauchy (Lorentz) distribution.

  • sample_cdf

    Samples a CDF.

  • sample_circle_arc

    Generates a uniform unit vector2, within maxangle of center, given a uniform number between 0 and 1.

  • sample_circle_edge_uniform

    Generates a uniform unit vector2, given a uniform number between 0 and 1.

  • sample_circle_ring_uniform

    Generates a uniform vector2 with alpha < length < 1, where 0 < alpha < 1, given a vector2 of uniform numbers between 0 and 1.

  • sample_circle_slice

    Generates a uniform vector2 with length < 1, within maxangle of center, given a vector2 of uniform numbers between 0 and 1.

  • sample_circle_uniform

    Generates a uniform vector2 with length < 1, given a vector2 of uniform numbers between 0 and 1.

  • sample_direction_cone

    Generates a uniform unit vector, within maxangle of center, given a vector2 of uniform numbers between 0 and 1.

  • sample_direction_uniform

    Generates a uniform unit vector, given a vector2 of uniform numbers between 0 and 1.

  • sample_discrete

    Returns an integer, either uniform or weighted, given a uniform number between 0 and 1.

  • sample_exponential

    Samples the exponential distribution.

  • sample_hemisphere

    Generates a unit vector, optionally biased, within a hemisphere, given a vector2 of uniform numbers between 0 and 1.

  • sample_hypersphere_cone

    Generates a uniform vector4 with length < 1, within maxangle of center, given a vector4 of uniform numbers between 0 and 1.

  • sample_hypersphere_uniform

    Generates a uniform vector4 with length < 1, given a vector4 of uniform numbers between 0 and 1.

  • sample_lognormal

    Samples the log-normal distribution based on parameters of the underlying normal distribution.

  • sample_lognormal_by_median

    Samples the log-normal distribution based on median and standard deviation.

  • sample_normal

    Samples the normal (Gaussian) distribution.

  • sample_orientation_cone

    Generates a uniform unit vector4, within maxangle of center, given a vector of uniform numbers between 0 and 1.

  • sample_orientation_uniform

    Generates a uniform unit vector4, given a vector of uniform numbers between 0 and 1.

  • sample_sphere_cone

    Generates a uniform vector with length < 1, within maxangle of center, given a vector of uniform numbers between 0 and 1.

  • sample_sphere_shell_uniform

    Generates a uniform vector with alpha < length < 1, where 0 < alpha < 1, given a vector of uniform numbers between 0 and 1.

  • sample_sphere_uniform

    Generates a uniform vector with length < 1, given a vector of uniform numbers between 0 and 1.

  • sampledisk

    Warps uniform random samples to a disk.

  • scale

    Scales the given matrix in three directions simultaneously (X, Y, Z - given by the components of the scale_vector).

  • select

    Returns one of two parameters based on a conditional.

  • sensor_panorama_create

    Sensor function to render GL scene and query the result.

  • sensor_panorama_getcolor

    Sensor function query a rendered GL scene.

  • sensor_panorama_getcone

    Sensor function to query average values from rendered GL scene.

  • sensor_panorama_getdepth

    Sensor function query a rendered GL scene.

  • sensor_save

    Sensor function to save a rendered GL scene.

  • serialize

    Flattens an array of vector or matrix types into an array of floats.

  • set

    Creates a new value based on its arguments, such as creating a vector from its components.

  • setagentclipnames

    Sets the current animation clips for an agent primitive.

  • setagentclips

    Sets the animation clips that an agent should use to compute its transforms.

  • setagentcliptimes

    Sets the current times for an agent primitive’s animation clips.

  • setagentclipweights

    Sets the blend weights for an agent primitive’s animation clips.

  • setagentcollisionlayer

    Sets the collision layer of an agent primitive.

  • setagentcurrentlayer

    Sets the current layer of an agent primitive.

  • setagentlocaltransform

    Overrides the local space transform of an agent primitive’s bone.

  • setagentlocaltransforms

    Overrides the local space transforms of an agent primitive.

  • setagentworldtransform

    Overrides the world space transform of an agent primitive’s bone.

  • setagentworldtransforms

    Overrides the world space transforms of an agent primitive.

  • setattrib

    Writes an attribute value to geometry.

  • setattribtypeinfo

    Sets the meaning of an attribute in geometry.

  • setcomp

    Sets a single component of a vector or matrix type, or an item in an array.

  • setdetailattrib

    Sets a detail attribute in a geometry.

  • setedgegroup

    Sets edge group membership in a geometry.

  • setpackedtransform

    Sets the transform of a packed primitive.

  • setpointattrib

    Sets a point attribute in a geometry.

  • setpointgroup

    Adds or removes a point to/from a group in a geometry.

  • setprimattrib

    Sets a primitive attribute in a geometry.

  • setprimgroup

    Adds or removes a primitive to/from a group in a geometry.

  • setprimintrinsic

    Sets the value of a writeable primitive intrinsic attribute.

  • setprimvertex

    Rewires a vertex in the geometry to a different point.

  • setvertexattrib

    Sets a vertex attribute in a geometry.

  • setvertexgroup

    Adds or removes a vertex to/from a group in a geometry.

  • setvertexpoint

    Rewires a vertex in the geometry to a different point.

  • shadowmap

    The shadowmap function will treat the shadow map as if the image were rendered from a light source.

  • shl

    Bit-shifts an integer left.

  • shr

    Bit-shifts an integer right.

  • shrz

    Bit-shifts an integer right.

  • sign

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

  • sin

    Returns the sine of the argument.

  • sinh

    Returns the hyperbolic sine of the argument.

  • sleep

    Yields processing for a certain number of milliseconds.

  • slerp

    Quaternion blend between q1 and q2 based on the bias.

  • slice

    Slices a sub-string or sub-array of a string or array.

  • slideframe

    Finds the normal component of frame slid along a curve.

  • smooth

    Computes ease in/out interpolation between values.

  • smoothrotation

    Returns the closest equivalent Euler rotations to a reference rotation.

  • snoise

    These functions are similar to wnoise.

  • solid_angle

    Computes the solid angle (in steradians) a BSDF function subtends.

  • solvecubic

    Solves a cubic function returning the number of real roots.

  • solvefbik

    Applies a full-body inverse kinematics algorithm to a skeleton.

  • solvepoly

    Finds the real roots of a polynomial.

  • solvequadratic

    Solves a quadratic function returning the number of real roots.

  • sort

    Returns the array sorted in increasing order.

  • specular

    Returns a specular BSDF or computes specular shading.

  • specularBRDF

    Returns the computed BRDFs for the different lighting models used in VEX shading.

  • spline

    Samples a value along a polyline or spline curve.

  • split

    Splits a string into tokens.

  • split_bsdf

    Splits a bsdf into its component lobes.

  • splitpath

    Splits a file path into the directory and name parts.

  • sprintf

    Formats a string like printf but returns the result as a string instead of printing it.

  • sqrt

    Returns the square root of the argument.

  • sssapprox

    Creates an approximate SSS BSDF.

  • startswith

    Returns 1 if the string starts with the specified string.

  • strip

    Strips leading and trailing whitespace from a string.

  • strlen

    Returns the length of the string.

  • sum

    Returns the sum of a list of numbers.

  • surfacedist

    Finds the distance of a point to a group of points along the surface of a geometry.

  • switch

    Use a different bsdf for direct or indirect lighting.

  • swizzle

    Rearranges the components of a vector.

  • tan

    Returns the trigonometric tangent of the argument

  • tanh

    Returns the hyperbolic tangent of the argument

  • tet_adjacent

    Returns primitive number of an adjacent tetrahedron.

  • tet_faceindex

    Returns vertex indices of each face of a tetrahedron.

  • teximport

    Imports attributes from texture files.

  • texprintf

    Similar to sprintf, but does expansion of UDIM or UVTILE texture filename expansion.

  • texture

    Computes a filtered sample of the texture map specified.

  • texture3d

    Returns the value of the 3d image at the position specified by P.

  • texture3dBox

    This function queries the 3D texture map specified and returns the bounding box information of the file.

  • titlecase

    Returns a string that is the titlecase version of the input string.

  • toNDC

    Transforms a position into normal device coordinates.

  • tolower

    Converts all characters in string to lower case

  • toupper

    Converts all characters in string to upper case

  • translate

    Translates a matrix by a vector.

  • translucent

    Returns a Lambertian translucence BSDF.

  • transpose

    Transposes the given matrix.

  • trunc

    Removes the fractional part of a floating point number.

  • tw_nspace

    Transforms a normal vector from Texture to World space.

  • tw_space

    Transforms a position value from Texture to World space.

  • tw_vspace

    Transforms a direction vector from Texture to World space.

  • uniqueval

    Returns one of the set of unique values across all values for an int or string attribute.

  • uniquevals

    Returns the set of unique values across all values for an int or string attribute.

  • unpack_intfromsafefloat

    Reverses the packing of pack_inttosafefloat to get back the original integer.

  • unserialize

    Turns a flat array of floats into an array of vectors or matrices.

  • upush

    Adds a uniform item to an array.

  • uvdist

    Finds the distance of a uv coordinate to a geometry in uv space.

  • uvintersect

    This function computes the intersection of the specified ray with the geometry in uv space.

  • uvsample

    Interpolates the value of an attribute at certain UV coordinates using a UV attribute.

  • uvunwrap

    Computes the position and normal at given (u, v) coordinates.

  • variance

    Computes the mean value and variance for a value.

  • vertex

    Reads a vertex attribute value from a geometry.

  • vertexattrib

    Reads a vertex attribute value from a geometry.

  • vertexattribsize

    Returns the size of a geometry vertex attribute.

  • vertexattribtype

    Returns the type of a geometry vertex attribute.

  • vertexattribtypeinfo

    Returns the type info of a geometry attribute.

  • vertexhedge

    Returns the half-edge which has a vertex as source.

  • vertexindex

    Converts a primitive/vertex pair into a linear vertex.

  • vertexnext

    Returns the linear vertex number of the next vertex sharing a point with a given vertex.

  • vertexpoint

    Returns the point number of linear vertex in a geometry.

  • vertexprev

    Returns the linear vertex number of the previous vertex sharing a point with a given vertex.

  • vertexprim

    Returns the number of the primitive containing a given vertex.

  • vertexprimindex

    Converts a linear vertex index into a primitive vertex number.

  • vnoise

    Generates Voronoi (cellular) noise.

  • volume

    Returns the volume of the microvoxel containing a variable such as P.

  • volumegradient

    Calculates the volume primitive’s gradient.

  • volumeindex

    Gets the value of a specific voxel.

  • volumeindexorigin

    Gets the index of the bottom left of a volume primitive.

  • volumeindextopos

    Converts a volume voxel index into a position.

  • volumeindexv

    Gets the vector value of a specific voxel.

  • volumepostoindex

    Converts a position into a volume voxel index.

  • volumeres

    Gets the resolution of a volume primitive.

  • volumesample

    Samples the volume primitive’s value.

  • volumesamplev

    Samples the volume primitive’s vector value.

  • volumevoxeldiameter

    Computes the approximate diameter of a voxel.

  • vtransform

    Transforms a directional vector.

  • warning

    Reports a custom runtime VEX warning.

  • wireblinn

  • wirediffuse

  • wnoise

    Generates Worley (cellular) noise.

  • wo_nspace

    Transforms a normal vector from World to Object space.

  • wo_space

    Transforms a position value from World to Object space.

  • wo_vspace

    Transforms a direction vector from World to Object space.

  • wt_nspace

    Transforms a normal vector from World to Texture space.

  • wt_space

    Transforms a position value from World to Texture space.

  • wt_vspace

    Transforms a direction vector from World to Texture space.

  • xnoise

    Simplex noise is very close to Perlin noise, except with the samples on a simplex mesh rather than a grid. This results in less grid artifacts. It also uses a higher order bspline to provide better derivatives.

  • xnoised

    Derivatives of Simplex Noise.

  • xyzdist

    Finds the distance of a point to a geometry.

  • xyztorgb

    Convert CIE XYZ tristimulus values to a linear sRGB triplet.

VEX contexts

Shading contexts

See common shading context features for information specific to the shading contexts.

  • displace

    Define a displacement shader with a program that moves a point on a surface before the surface is rendered.

  • fog

    Deprecated. Define a fog shader with a program that modifies the Cf, Of, or Af values to simulate atmospheric effects.

  • light

    Define a light shader with a program called from surface or fog shaders to calculate the illumination of a surface.

  • shadow

    Define a shadow shader by defining a program that’s called from surface or fog shaders to calculate the occlusion on a surface from a light source.

  • surface

    Define a surface shader with a program that sets the final color, opacity, and alpha of a surface being rendered.

Other contexts

  • cvex

  • chop

    Define a custom CHOP operator with a program that edits channel values.

  • cop2

    Define a custom COP operator with a program that sets RGBA or Cr,Cg,Cb,C4 values in an image.

Obsolete contexts

  • image3d

    Obsolete. Write a program for use with the i3dgen program to generate 3D textures.

  • pop

    Obsolete. Define a custom POP operator with a program that edits particle attributes.

  • sop

    Obsolete. Define a custom SOP operator with a program that edits geometry point attributes.