int vertexprimindex(<geometry>geometry, int linearindex)
When running in the context of a node (such as a wrangle SOP), this argument can be an integer representing the input number (starting at 0) to read the geometry from.
Alternatively, the argument can be a string specifying a geometry file (for example, a
.bgeo) to read from. When running inside Houdini, this can be an
The linear index of a vertex
The vertex’s number within the primitive that contains it, or
-1 if the vertex has no primitive.
To get the primitive number of the containing primitive, use vertexprim.
Due to the nature of the geometry structure, the first time this is run on a geometry it has to run over all primitives to find the look up table. This will be amortized out if most vertices are invoking this function.
int prim, vtx; // Find the primitive and vertex offset of the linear vertex 6. prim = vertexprim("defgeo.bgeo", 6); vtx = vertexprimindex("defgeo.bgeo", 6);