Houdini 20.0 VEX

Working with geometry groups in VEX

You can read the contents of primitive/point/vertex groups in VEX as if they were attributes.

On this page

Dedicated functions

VEX has a number of functions for working with geometry groups:

Get the number of elements in a group

Test if a given element number is in a group

Convert a group name or group syntax into a list of point/primitive numbers

Modify the contents of a named group

Adding an element to a non-existent group creates the group.

Getting the existing groups

You can get an array of existing group names by reading the “intrinsic” detail attributes edgegroups, pointgroups, primitivegroups, or vertexgroups.

string groups[] = detailintrinsic(0, "pointgroups")

Reading groups as attributes

The generic attribute reading function attrib takes an attribclass argument that lets you specify what geometry level (detail, primitive, point, or vertex) to read the attribute from.

You can instead specify "primgroup", "pointgroup", or "vertexgroup" as the class to read group contents as if they were attributes.

VEX

Language

Next steps

Reference