Code in Houdini

Houdini expression and script snippets.

Point cloud lookup.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
float radius = chf("radius");
int maxpoints = chi("maxpoints");

int handle = pcopen(0, "P", v@P, radius, maxpoints);

int cloud_ptnum = -1;
float cloud_dist = 0.0;
vector cloud_P = {0.0, 0.0, 0.0};
vector cloud_foo = {0.0, 0.0, 0.0};

while (pciterate(handle)) 
{
    // Skip self
    pcimport(handle, "point.number", cloud_ptnum);
    if (cloud_ptnum == i@ptnum) continue;

    pcimport(handle, "point.distance", cloud_dist);
    pcimport(handle, "P", cloud_P);
    pcimport(handle, "foo", cloud_foo);
}

Default node color.

1
2
3
4
5
import soptoolutils

node = soptoolutils.genericTool(kwargs, '$HDA_NAME')

node.setColor(hou.Color(.4392, .3804, 0.7843))

Grab input.

1
bbox(opinputpath(".", 0), D_YMAX)

SOP-style group pattern such as 0-10 or @Cd.x>0.5. An empty string will match all points.