Vertex groups reside inside the geometry, and each vertex 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 vertex 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.createVertexGroup to control
whether a group is ordered.
See hou.Vertex for more information about vertices. See also hou.PrimGroup, hou.PointGroup, and hou.EdgeGroup.
Methods ¶
name()
Return the name of the group. Each vertex group has a unique name.
geometry()
→ hou.Geometry
Return the geometry object containing this group.
vertices()
→ tuple
of hou.Vertex
Return the contents of this group.
See also hou.VertexGroup.iterVertices.
iterVertices()
→ generator of hou.Vertex
Return a generator that iterates through all the contents of this group.
Whereas hou.VertexGroup.vertices allocates and returns a tuple of all the vertices in the group, this method returns a generator object that will yield hou.Vertex objects on demand.
contains(vertex)
→ bool
Return whether or not a vertex is in this group.
Raises hou.OperationFailed if the vertex belongs to a different geometry object than this group.
vertexCount()
→ int
Returns the number of vertices in this group.
isOrdered()
→ bool
Returns whether or not this group is ordered.
add(vertex_or_list_or_vertex_group)
If given a hou.Vertex or a list of hou.Vertex's, add the vertex (vertices) to the group. If given a hou.VertexGroup, merge the contents of the other vertex 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 vertices to the group that were already in the group.
Raises hou.GeometryPermissionError if this geometry is not modifiable.
Raises hou.OperationFailed if the vertex or vertex group belong to a different geometry object than this group.
remove(vertex_or_list_or_vertex_group)
If given a hou.Vertex or a list of hou.Vertex's, remove the vertex from the group. If given a hou.VertexGroup, remove all vertices 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 vertex from the group that wasn’t already in the group.
Raises hou.GeometryPermissionError if this geometry is not modifiable.
Raises hou.OperationFailed if the vertex belongs to a different geometry object than this group.
clear()
Remove all vertices from this group. You would typically call this method from the code of a Python-defined SOP.
The vertices 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 vertex group.
Note that the contents of this dictionary are saved to geometry files.
See also hou.VertexGroup.option, hou.VertexGroup.setOption and hou.VertexGroup.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.VertexGroup.options, hou.VertexGroup.setOption and hou.VertexGroup.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.VertexGroup.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.VertexGroup.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.