

Int near_pts = pcfind_radius(0, "P", "pscale", 1.0, max_dist, max_pts) The cool thing about this is that we can easily use the pscale as radius for the search and search just in a specific group of //points The cool thing is that it returns directly an array and not a //point cloud. Int neighbour_points = you are a fan of point clouds there is also a function called pcfind_radius. Int nearpoint = (0, There is also the neighbours function which gives us a list of points connected to the point through some sort of primitives. By default, parameters in Houdini use the traditional HScript expression language explained below. But as before if we run it in the same //geometry, we are not going to get the real closest point There is also the nearpoint function which returns just an integer with the closest point. Houdini 19.5 Nodes Channel nodes Channel Wrangle channel node Runs a VEX snippet to modify channel data.

Int closest_point = near_pts //take the second element of the list, so index number 1 Just like os.getcwd is a function in the os module, hou.frame is a function in the hou module, and it returns the current frame number. Int near_pts = max_dist, max_points) // create a list of all points in the radius until reaches max_points the first, but the second element in the list (which has index number 1). The geometry level or SOPs level contains the actual geometry (stating the bloody obvious there) which is made up of the raw building blocks of geometry, points, prims, verts and volumes whilst the Houdini object node contains world space translation, scale and rotation information allowing the geometry to be positioned in your scene at will. If we need the real closest point, we have to take not For Houdini the closest point in the same geometry is going to be itself. If we look at the closest point in the same geometry coming from the first input ( so input number 0) there is another thing to keep in // mind. Pay attention that this function returns a list of all the points, so returns an array (that's why I added to the attribute name). We can specify how far we search and the maximum amount of points Nearpoints function returns the closest points to the current. Int inst = uniqueval(0,"point","sourcept", i) //the unique value at index inst) //put all the unique values in an array called There are several ways to find the closest points and there are a couple of things to keep in mind Int n = numiqueval(0, "point", "sourcept") //the amount of unique values in the attribute "sourcept" For some reasons we don't know the number of source //particles, but we need to know their values and put all of them in an array. Each //sourced particle is storing the point number of the particle it's sourced from. Let's say in this case let's say we have a certain number of particles sourcing 100+ particles each. For example if the unique values are 9 and in the function you put 9 as index, is // going to return the 9th and last unique value uniqueval returns the unique value at a certain index. numiqueval is going to return the integer number of unique values stored in an attribute I haven't used this a lot but I've found "numiqueval" and "uniqueval" useful a couple of times, especially for loops.
