+ HOUDINI NIBBLES

A collection of small, perhaps useful notes on Houdini

RBD

// first get the vertex, then get the point
// that are associated to the vertex
int pt_0 = vertexpoint(0, primvertex(0, @primnum, 0));
int pt_1 = vertexpoint(0, primvertex(0, @primnum, 1));

Python

If you want info on how to create a node using python the asCode is your friend. It will print the Python code necessary to recreate a node. Create the node, edit the param interface and run the function. To print it to a file the snippet below can be run in the python shell.

with open('/path/to/as_code.py', 'w') as f:
    f.write(hou.node('obj/geo1/my_node').asCode())

UDIM offset

Texture path:

your_tex_name.%(UDIM)d.ext

point wrangle:

@uv[0] += chi('udim')%10;
@uv[1] += chi('udim')/10;

Rendering

When outputting depth pass image plane we want the Sample Filter to be Closest surface to avoid artifacts that can occur if the surface has opacity. We also want the Pixel Filter to be set to Closest Sample (minmax min) The same goes for other utility passes for instance passes used to do relighting.

Sample Filter Closest surface
Pixel Filter Closest Sample (minmax min)