Before Groups: 1. Oversimplified Attributes — The Data 🟢

The Fundamentals

A group is a named selection of geometry.

A group is geometry membership, not attribute data.

Groups are similar to a boolean attribute: an element is either in or out of the group.

Groups can overlap. An element can belong to multiple groups at the same time.

<aside>

Attributes → What is this element like?

Groups → Which elements are we talking about?

</aside>

Why Groups Exist - "Do this operation, but only to these elements."

This gives Houdini two complementary ways of organizing geometry:

Attributes → "What is this element like?"

Groups → "Which elements are we talking about?"

For example

100,000 points
      ↓
group "debris"
      ↓
Transform
      ↓
only debris moves

sheet_groups_gerardojustel_re1mon copy.png


Group Types

Point Groups

Contain points.

Primitive Groups

Contain primitives.

Vertex Groups

Contain vertices.

Edge Groups

Contain edges.

Note: Edges aren't a separate geometry element. An edge represents a relationship between two points, but Houdini can still maintain edge groups.


Creating & Using Groups

Groups can be created, modified, and used through:

For example, if a node has a Group parameter, you can tell it:

debris

and the node will operate only on the elements in that group.

The simplest way to work with a group is often through the Group parameter on a SOP node.

image.png


Groups in VEX

VEX provides functions for working with groups.

Create / Modify

These functions can add or remove elements from groups.

setpointgroup()
setprimgroup()
setvertexgroup()

Count Member

Returns the number of elements belonging to a group.

npointsgroup()
nprimitivesgroup()
nverticesgroup()

Vex Example

See Groups

Check Membership

Returns whether an element belongs to a group.

inpointgroup()
inprimgroup()
invertexgroup()

Get Elements

Returns an array containing the element numbers belonging to a group.

expandpointgroup()
expandprimgroup()
expandvertexgroup()

Group Expressions

Group expressions let you select, combine, exclude, and filter elements.

Select a Group

Select everything belonging to group1.

group1

AND — Intersection

Select elements belonging to both groups.

group1 &group2

Element Ranges