[SESI logo]

VEX Language Reference - Version 6.2

Side Effects Software Inc. 2003

Changes since Houdini 4.1

These are highlights of major changes since the 4.1 release of houdini.

  • General Changes
  • Shading Context Changes
  • OP Context Changes

  • General Changes

  • There is a new export pragma to allow the export of parameters to the operation controls bar or the operation parameters dialog.

  • There is a new VEX context to generate 3D texture images.

  • There is a new VEX context for COP2.

  • There are new 3D texture map functions to evaluate/integrate over 3D texture maps.

  • There is a new function cracktransform() which will take a matrix and decompose it into its component translation and Euler angle rotations.

  • There are several functions which can access external geometry files.
  • npoints()
  • intersect()
  • metaweight()
  • prim_normal()
  • prim_attribute()
  • Please see documentation for these functions.

  • A new pragma (#pragma callback) has been added to allow hscript commands to be run when a toggle button or menu parameter is changed.

  • The preprocessor in vcc has had minor alterations regarding the pasting operator (##) and now supports the stringize operator (#X).

  • The preprocessor has a non-ANSI addition to check for the existence of environment variables. For example: #if defined(DO_THIS) || environment(DO_THAT) will evaluate true if DO_THIS has been defined, or if an enviornmnet variable DO_THAT is defined on the system.

  • The VEXop operator tables are now pre-processed by an internal cpp processor. Standard C/C++ comments are handled properly (along with hash-style comments previously supported). It is also possible to add #define, #ifdef, etc. statements. A side-effect of this modification is that the include directive should now be prefixed with a hash mark. Warnings will be generated by old-style includes (which may not be supported in future releases).

  • There is an environment variable check for HOUDINI_SCRIPT_DEBUG. Setting this environment variable to 1 will cause debugging information to be printed out to the console when operator tables are being loaded which may help in determining why VEX operators don't show up in Houdini.

  • The printf and sprintf functions can now print integers/floats with leading zeros for the field width. This allows generation of padded file names etc. For example: int ival = 32; string mapname = sprintf("somepath.%04d.rat", ival); will generate "somepath.0032.rat" as the resulting string.


  • Shading Context Changes

  • Derivative computation has been improved. There are now optional arguments on most functions which use derivatives to control the computation of derivatives.

    The extrapolation option also applies to the cinput() functions in the COP/COP2 contexts.

  • The texture mapping code now takes an optional argument (lerp) which can help to remove discontinuities when different MIP levels of .rat files are accessed. Textures may be slightly softer with this option turned on and render times may increase. However, this should remove discontinuities or visible jumps in texture mapping. Please see the filter options for further information.

  • In the light and shadow contexts, there is a new function to query whether the lighting computation is being used for shading fog or surfaces. This allows users to optimize lighting/shadow shading when ray-marching through fog.

    Please see documentation for isfogray().

  • There are new functions in the shading contexts to query the transform spaces of other objects. otransform(), ltransform(), ftransform() allow access to the world space transforms of geometry, light or fog objects.

  • There's a new function getlightname() which returns the name of the current light inside illuminance loops. The function will return an empty string outside of illuminance loops.

  • There's a new function getobjectname() which returns the name of the current light, geometry or fog object which is being shaded.

  • There are new functions to perform ray-intersection tests. The rayhittest function will send a ray and return the distance to the first intersection. Optionally, it can also return the position and surface normal of the surface intersected.

  • All ray-tracing functions now take optional arguments which can specify the scope of objects to perform intersection tests against. These functions are:

  • All illumination functions now take optional arguments which can specify the light mask of illuminating lights. The illumination functions affected are:

  • In the light/shadow contexts, the L variable is now correctly initialized for Houdini lights with orthographic projections. Please see here for further information.


  • OP Context Changes

  • It is now possible to create arbitrarily named attributes in Sop and Pop contexts using the addattribute() function.

  • There is a new VEX context "cop2" to generate VEX code for the new compositor.



  • Copyright © 1999-2003 Side Effects Software Inc.
    477 Richmond Street West, Toronto, Ontario, Canada M5V 3E7