Point groups reside inside the geometry, and each point group has a unique name.
Groups are either ordered or unordered. When asking for the contents of an
ordered group, the results will be returned in the order they were added to
to the group. For an unordered group, the results will be returned in an
arbitrary order (though it is normally arranged by increasing point number).
When creating a group using the group SOP, use the ‹Create Ordered› checkbox
to create an ordered group. When creating one from Python, Use the
is_ordered
parameter of hou.Geometry.createPointGroup to control
whether a group is ordered.
See hou.Point for more information about points. See also hou.PrimGroup, hou.VertexGroup, and hou.EdgeGroup.
Methods ¶
name()
Return the name of the group. Each point group has a unique name.
geometry()
→ hou.Geometry
Return the geometry object containing this group.
points()
→ tuple
of hou.Point
Return the contents of this group.
See also hou.PointGroup.iterPoints.
iterPoints()
→ generator of hou.Point
Return a generator that iterates through all the contents of this group.
Whereas hou.PointGroup.points allocates and returns a tuple of all the points in the group, this method returns a generator object that will yield hou.Point objects on demand.
contains(point)
→ bool
Return whether or not a point is in this group.
Raises hou.OperationFailed if the point belongs to a different geometry object than this group.
pointCount()
→ int
Returns the number of points in this group.
isOrdered()
→ bool
Returns whether or not this group is ordered.
add(point_or_list_or_point_group)
If given a hou.Point or a list of hou.Point's, add the point(s) to the group. If given a hou.PointGroup, merge the contents of the other point group with this group (the other group is unaffected). You would typically call this method from the code of a Python-defined SOP.
It is ok to add points to the group that were already in the group.
Raises hou.GeometryPermissionError if this geometry is not modifiable.
Raises hou.OperationFailed if the point or point group belong to a different geometry object than this group.
remove(point_or_list_or_point_group)
If given a hou.Point or a list of hou.Point's, remove the point from the group. If given a hou.PointGroup, remove all points in the other group from this group (the other group is unaffected). You would typically call this method from the code of a Python-defined SOP.
It is not an error to try to remove a point from the group that wasn’t already in the group.
Raises hou.GeometryPermissionError if this geometry is not modifiable.
Raises hou.OperationFailed if the point belongs to a different geometry object than this group.
clear()
Remove all points from this group. You would typically call this method from the code of a Python-defined SOP.
The points remain in the geometry; only the group is affected.
Raises hou.GeometryPermissionError if this geometry is not modifiable.
destroy()
Remove this group from the geometry. You would typically call this method from the code of a Python-defined SOP.
Raises hou.GeometryPermissionError if this geometry is not modifiable.
options()
→ dict
of str
to bool
, int
, float
, str
Return a dictionary containing the extra options attached to this point group.
Note that the contents of this dictionary are saved to geometry files.
See also hou.PointGroup.option, hou.PointGroup.setOption and hou.PointGroup.removeOption.
option(name)
→ bool
, int
, float
, str
, hou.Vector2, hou.Vector3, hou.Vector4, hou.Quaternion, hou.Matrix3, hou.Matrix4, tuple of int
, or tuple of float
Return the value of an individual option, on None
if no such option
exists.
See also hou.PointGroup.options, hou.PointGroup.setOption and hou.PointGroup.removeOption.
optionType(name)
→ hou.fieldType enum value
Return a hou.fieldType enumerated value that describes the type
of data stored in an option. Returns hou.fieldType.NoSuchField
if
no field exists with that name.
setOption(name, value, type_hint = hou.fieldType::NoSuchField)
Set an entry in the dictionary of options. See hou.PointGroup.options for more information.
name
The name of the option to set.
value
An integer, float, string, hou.Vector2, hou.Vector3, hou.Vector4, hou.Quaternion, hou.Matrix3, hou.Matrix4, or sequence of numbers.
type_hint
Used to determine the exact hou.fieldType desired when the specified value type is not enough to unambiguously determine it.
removeOption(name)
Remove an entry in the dictionary of options. See hou.PointGroup.options for more information.
Raises hou.OperationFailed if there is no entry in the dictionary with this name.
dataId()
Returns the data id that represents the contents of this group.
incrementDataId()
Increment the data id to indicate that the contents of this group has changed.