## Houdini Cheat Sheet

Here’s a quick cheat sheet for Houdini that I wrote ages ago. It’s probably got about 95% of what you need to use when you first start out using Houdini.

Hope you find it useful.

### Common Houdini Surface operators (SOPs)

Box, Sphere, Grid, Tube, Circle, Line, Torus, Curve |
Some basic operators that give you geometry primitives |

File |
Loads a mesh (obj, bgeo, etc) |

Trace |
Uses a threshold to generate geometry from an image |

Add |
Creates individual points and/or polygons |

Merge |
Combines multiple pieces of geometry |

Point |
Manipulates point properties and attributes. The second input allows operations between two sets of points from different sources providing they have the same number. |

Primitive |
Manipulates primitive (usually polygons) properties and attributes |

Transform |
Moves, rotates, and scales geometry |

Facet |
Most commonly used to calculate normals, but does a few other things too. |

Group |
Allows you to assign a group to a set of vertices, points, or primitives. (A bit like XSI’s Clusters) |

Copy |
Copies input geometry. The second input allows you to copy the geometry from the first input, onto each point of the second input. This operator allows loop-style processing by using the Copy/Stamp feature. |

Delete |
Deletes geometry. Can be used with a Copy operator to perform loop-style processing. |

AttribCreate |
Allows you to store custom information at each vertex, point, primitive, or object |

AttribTransfer |
Copies attributes from one piece of geometry to another. The geometry does not have to match (just like XSI’s GATOR). |

AttribPromote |
Allows you to do various statistics on an attribute (e.g. average, minimum, maximum, mode, sum of squares, etc.) and transfer it to the corresponding vertex, point, or primitive. |

Measure |
Allows you to calculate polygon area, perimeter or mesh curvature. |

Cache |
Stores geometry in memory to allow for faster previews. |

Trail |
Can calculate per a point velocity, or generate trails of points from animated geometry. |

Skin |
Performs a “loft” style operation |

Resample |
Redistributes points along a curve |

Ray |
Does ray tracing based on point nomal. Can be used to shrink wrap one mesh onto another. |

Cookie, Boolean |
Different types of Boolean style operations |

Sort |
Can sort point order based on various things. |

Peak |
Transforms points based on their normals |

Connectivity |
Creates an attribute with a value based on connectivity information. Works well with Partition operator |

Partition |
Assigns geometry to a group based on an attribute value. Often used with the Connectivity operator |

### Common Houdini Expressions

You can find the full list of expressions here:

http://www.sidefx.com/docs/houdini11.0/expressions/

ch(<parameter path>) |
Gets the current value of the parameter |

chf(<parameter path>,<frame> ) |
Gets the value of the parameter at a particular frame |

stamp(<Copy SOP path>, <stamp variable>, <default value>) |
Retrieves the current value of the specified stamp variable (See Houdini docs for more info on the copy-stamping process) |

point(<SOP path>, <point number>, <attribute name>, <index>) |
Retrieves a point attribute value. If attribute is a vector (e.g. position), then index specifies vector component (e.g., 0=”x”, 1=”y”, 2=”z”) |

prim(<SOP path>, <point number>, <attribute name>, <index>) |
Same as point, but for primitives |

clamp(<value>,<min>,<max>) |
Keeps the value within the minimum and maximum values |

fit(<value>,<min>,<max>,<newmin>,<newmax>) |
Remaps the value from the old range to the new range and clamps it. |

fit01(<value>,<newmin>,<newmax>) |
Just like fit() but assumes value is already in the range 0 to 1. |

smooth(<value>,<min>,<max>) |
Outputs a smoothed value between 0 and 1 as value goes from minimum to maximum. |

noise(<x>, <y>, <z>) |
Returns a noise value for a given position in space. |

rand(<seed>) |
Gives a random number based on the seed value. The returned value will always be the same for a particular seed. |

length(<x>, <y>, <z>) |
Returns the length of the vector |

distance(<x1>, <y1>, <z1>,<x2>, <y2>, <z2>) |
Returns the distance between two points |

if(<expr>, <value if true>, <value if false>) |
Gives a choice of two values depending on the expression evaluating to true or false |

opinputpath(<operator path>, <input index>) |
Returns the path of the operator connected to the input specified by the input index. |

bbox(<SOP path>, <dimension type>) |
Returns the required measurement of the bounding box of some geometry. “dimension type” can be one of these:
D_XMIN, D_YMIN, D_ZMIN, D_XMAX, D_YMAX, D_ZMAX, D_XSIZE, D_YSIZE, D_ZSIZE |

centroid(<SOP path>, <dimension type>) |
Returns the X, Y, or Z position of the center of the bounding box. “dimension type” can be one of these:
D_X, D_Y, D_Z |

pic(<COP path>, <u>, <v>, <color type>) |
Returns the interpolated pixel color from a compositing operator at the specified UV. “color type” can be one of these:
D_CR, D_CG, D_CB, D_CA, D_CHUE, D_CSAT, D_CVAL, D_CLUM |

Houdini expressions also contain the common mathematical functions that are found in most scripting and expression languages. Here are just a few:

sin, cos, tan, asin, acos, atan, atan2, abs, pow, sqrt, ceil, floor, atof, dot, cross, deg, rad, exp, frac, hsv, rgb, min, max, log, log10, round, substr, strreplace

Note: Trigonometric functions accept angles in degrees.

The modulus operation is achieved using the % character, and boolean logic is achieved using the standard C operators, i.e. <. >, <=, >=, ==, !=, !

### Common Houdini Expression Local Variables

Important: The following variables are NOT available in every operator. Each operator has its own local variables, and you can find which ones in Houdini’s help documentation. The ones listed here are the ones you’ll most commonly encounter.

$PT | Point number. Used in most SOPs that manipulate points |

$PR | Primitive number. Used in most SOPs that manipulate primitives |

$CY | Used by the Copy SOP to identify the current copy being made. the second Copy input is being used, in which case $PT will be used instead.Unless |

$TX, $TY, $TZ | Position of a point |

$NX, $NY, $NZ | Normal of a point/primitive |

$CR, $CG, $CB, $CA | Color of a point/primitive |

$VX, $VY, $VZ | Velocity of a point |

$BBX, $BBY, $BBZ | The normalised (0 to 1) position of the point in the bounding box |

$CEX, $CEY, $CEZ | Centroid of the geometry |

$AGE | Number of seconds a particle has been alive |

$LIFE | Normalised age (0 to 1) of a particle |

$XMIN, $XMAX, etc. | Extents of the bounding box |

$SIZEX, $SIZEY, $SIZEZ | Size of the bounding box |

$TX2, $TY2, $TZ2 | Used to identify the position of a point coming from the second input of a Point SOP. Similarly for other attributes, e.g. Normals, $NX2, etc. |

Jeremysaid:This should come in handy, especially the expressions. Thanks for sharing.

AndyN (author)said:Great! I’m glad I posted it then. Like I said, it was something I put together ages ago when I was still trying to remember all of this, so I’m glad at least one other person has found it of some use! 😉

Pablo Gimenezsaid:Thanks Andy!

Quite useful for Houdini newbies.

AndyN (author)said:Thanks Pablo! Do feel free to suggest anything you think I’ve missed.

(And a belated congrats on your new arrival! Hope you’re getting enough sleep!)

Cheers

A

Indusaid:Thanks a lot Andy, for Sharing this much useful Notes..

Its really a great and worthy help for me.

carry on

Kevin Mitchellsaid:Really helpful cheat sheet. Thanks!

AndyN (author)said:No problem, thanks for the thanks!

A

Erwannsaid:Thanks Andy, definitely handy yeah !!

Stevesaid:This is awesome and so helpful. i was in the process of writing this for myself.. Please never take this down…

AndyN (author)said:Thanks Steve!

Vladsaid:Nice work, Andy!

But please correct: opinput(, ) is

NOTreturn the path but return theNAMEof connected node.For a path you shall use: opinputpath(name, index)

AndyN (author)said:Well spotted. Nice one Vlad, thanks. Just updated it.

Andy

Noel Frogersaid:thanks !

very useful and a good companion for all people transitioning from Softimage to Houdini 😉

nono

Peter McMullansaid:Great job, I use this every day, thx dude!

David Wigforsssaid:Super helpful, Andy. Thanks for compiling this.