definePartitionedSubsets#

Fully qualified name: usdex::core::definePartitionedSubsets

std::vector<pxr::UsdGeomSubset> usdex::core::definePartitionedSubsets(
pxr::UsdGeomMesh mesh,
const std::vector<pxr::TfToken> &names,
const std::vector<pxr::VtIntArray> &indices,
const pxr::TfToken &elementType = pxr::UsdGeomTokens->face,
const pxr::TfToken &familyName = pxr::UsdShadeTokens->materialBind,
)#

Fully partitions a geometry prim into multiple disjoint subsets.

Every element of the geometry must appear in exactly one subset in this family, with no element appearing in more than one subset, and no element left unassigned.

The prim must be a geometry that supports subsets (e.g. UsdGeomMesh from usdex::core::definePolyMesh). Use usdex::core::bindMaterial to bind materials to each subset.

elementType defaults to UsdGeomTokens->face. See UsdGeomSubset for details.

familyName defaults to UsdShadeTokens->materialBind. See UsdGeomSubset for details.

Parameters:
  • mesh – Mesh prim to add the subsets to

  • names – The names of the subsets (size must equal indices.size())

  • indices – Per-subset element indices; indices.size() is the number of subsets, indices[i] is the index list for subset i

  • elementType – The element type of the subsets. Valid values are UsdGeomTokens->face, UsdGeomTokens->edge, and UsdGeomTokens->point.

  • familyName – The family name of the subsets

Returns:

The subsets created