Deborah R. Fowler
Wrangle Nodes
Posted on Aug 25 2013
Updated on Oct 17 2018
See Wrangle Node Examples
Wrangle Node Quick
Reference
Wrangle nodes are an extremely powerful and easy way to add code/customized nodes to your houdini network. See also VEX/VOPS and a little Python
Also incredibly useful is a table of HSCRIPT and VEX comparison from SideFX
Wrangle nodes use a subset of the VEX language, sometimes referred to as VEX snippets (like vex with fewer high level constructs). If you have a background in C++ the syntax will come easily with a few added features. Under Wrangle node examples you will see an increasing set of tutorials and example files. The best way to learn VEX is to use it to solve a problem.
Why use them? VEX or point wrangle nodes are 10x faster than the point SOP!
When getting started, some things to node are:
- @ symbol
indicates an attribute - can be used for fetching or
creating
- abbreviations
are used for types - just
like in VEX (and C++) you have to declare the types and they
are shortened in the Wrangle nodes. ie. f@myVar =
7.0; or v@test = set(0,2,0);
In VEX (work in wrangle too)
In Wrangle
int
i
float
f
vector
v or v4
string
s
Arrays:
int myarray[];Also arrays! Either attribute or local
i[]@myarray;
- note that you can create attributes or use local variables.
For example, v@P1 will create an attribute but vector P1 no new
attributes is created, only the local variable (check the
geometry spreadsheet in this sample
hip here. Also, you can use i[]@myarray =
array(); to efficiently set up the
array.
- add parameters using the parameter
interface editor or you can add them using the symbol to the
right of the code as indicated in the diagram below
TIP: For a list of functions available in vex refer to the documentation or, on linux, type vcc -X sop in a terminal shell
(note for those on Windows go to SideEffectsSoftware/CommandLineToolsVersionNumber to open a window similar to unix (but is ms-dos with Houdini env initialized)